School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!
Welcome to Dream.In.Code
Become an Expert!

Join 340,149 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 3,882 people online right now. Registration is fast and FREE... Join Now!



Change Show Word At Data Report

Change Show Word At Data Report Rate Topic: -----

#1 leang86  Icon User is offline

  • New D.I.C Head
  • Pip
  • Group: Members
  • Posts: 26
  • Joined: 25-May 09


Dream Kudos: 0

Post icon  Posted 27 May 2009 - 07:56 PM

hi, i want to know how to change the show word at data report.
that mean i have a columm, it store the integer 1, 2, and 3. this integer are represent another meaning, so i want it show on my report with 1 = yes, 2 = no, 3 = unknown.

here are the coding that i write in the data environment:

SELECT custName, bottle_ID, Product_Type, Date1, `Level` as level1, PRM, Room, Location, confiscate, status, LastTransDate,
case when status = 1 then 'YES' 
when status = 2 then 'No'
else 'Unknown' end as Status2
FROM bottleHdr
where custName like CustName1Res



please help me..............
tq!!!!!!!!!!!!!!!!!!!!!!

** Edit ** :code:
Was This Post Helpful? 0
  • +
  • -


#2 paperclipmuffin  Icon User is offline

  • WinWinWinWindows?
  • Icon
  • View blog
  • Group: Authors
  • Posts: 910
  • Joined: 16-April 09


Dream Kudos: 400

Posted 27 May 2009 - 09:20 PM

Hi,

Please post your code between code tags.

On to helping, I would suggest using a true\false boolean. It would work a lot better, and you else to find a third value. If you need further explanation, tell me.

If I was helpful, a thank you would be appreciated(below).
Was This Post Helpful? 0
  • +
  • -

#3 firebolt  Icon User is offline

  • D.I.C Lover
  • Icon
  • View blog
  • Group: Author w/DIC++
  • Posts: 5,555
  • Joined: 20-February 09


Dream Kudos: 1675

Posted 27 May 2009 - 11:05 PM

Like so :code:
Was This Post Helpful? 0
  • +
  • -

#4 thava  Icon User is offline

  • D.I.C Addict
  • Icon
  • Group: Expert
  • Posts: 990
  • Joined: 17-April 07


Dream Kudos: 75

Posted 28 May 2009 - 12:51 AM

is it going any thing wrong with your report mention it first
Was This Post Helpful? 0
  • +
  • -

#5 leang86  Icon User is offline

  • New D.I.C Head
  • Pip
  • Group: Members
  • Posts: 26
  • Joined: 25-May 09


Dream Kudos: 0

Posted 28 May 2009 - 05:57 PM

View Postpaperclipmuffin, on 27 May, 2009 - 09:20 PM, said:

Hi,

Please post your code between code tags.

On to helping, I would suggest using a true\false boolean. It would work a lot better, and you else to find a third value. If you need further explanation, tell me.

If I was helpful, a thank you would be appreciated(below).


SELECT custName, bottle_ID, Product_Type, Date1, `Level` as level1, PRM, Room, Location, confiscate, status, LastTransDate,
case when status = 1 then 'YES'
when status = 2 then 'No'
else 'Unknown' end as Status2
FROM bottleHdr
where custName like CustName1Res



How to use boolean in this situation?
can u give me an example?
Was This Post Helpful? 0
  • +
  • -

#6 June7  Icon User is offline

  • D.I.C Addict
  • Icon
  • Group: Members w/DIC++
  • Posts: 591
  • Joined: 09-December 08


Dream Kudos: 0

Posted 28 May 2009 - 08:55 PM

You can do it in the query as you have tried, does this one work? I have never seen case structure like that and never in a query. Then textbox on the report should be bound to Status2.
Or you can just use nested IIF statement in the textbox control source property.
= Iif([status] = 1, "Yes", Iif([status] = 2, "No", "Unknown"))
You could make the field 'status' in the data table a boolean field but think would still have to use some code to get the "Unknown" value to display, so same result.

This post has been edited by June7: 28 May 2009 - 08:57 PM

Was This Post Helpful? 0
  • +
  • -

#7 leang86  Icon User is offline

  • New D.I.C Head
  • Pip
  • Group: Members
  • Posts: 26
  • Joined: 25-May 09


Dream Kudos: 0

Posted 28 May 2009 - 11:27 PM

View PostJune7, on 28 May, 2009 - 08:55 PM, said:

You can do it in the query as you have tried, does this one work? I have never seen case structure like that and never in a query. Then textbox on the report should be bound to Status2.
Or you can just use nested IIF statement in the textbox control source property.
= Iif([status] = 1, "Yes", Iif([status] = 2, "No", "Unknown"))
You could make the field 'status' in the data table a boolean field but think would still have to use some code to get the "Unknown" value to display, so same result.



it's work, Thanks you.
Was This Post Helpful? 0
  • +
  • -



Fast Reply

  

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month