What's Here?
- Members: 340,149
- Replies: 920,517
- Topics: 154,948
- Snippets: 4,855
- Tutorials: 1,257
- Total Online: 3,882
- Members: 120
- Guests: 3,762
|
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!
Chat LIVE With a Expert
|
Change Show Word At Data Report
Change Show Word At Data Report
Rate Topic:
   

- New D.I.C Head
-
-
Group:
Members
-
Posts:
26
-
Joined:
25-May 09
Dream Kudos: 0
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 **
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).
Posted 27 May 2009 - 11:05 PM
Like so
Posted 28 May 2009 - 12:51 AM
is it going any thing wrong with your report mention it first

- New D.I.C Head
-
-
Group:
Members
-
Posts:
26
-
Joined:
25-May 09
Dream Kudos: 0
Posted 28 May 2009 - 05:57 PM
paperclipmuffin, 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?
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

- New D.I.C Head
-
-
Group:
Members
-
Posts:
26
-
Joined:
25-May 09
Dream Kudos: 0
Posted 28 May 2009 - 11:27 PM
June7, 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.
1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users
|
Be Social
Programming
Web Development
Reference Sheets
Bye Bye Ads
Monthly Drawing
Top Contributors
Top 10 Kudos This Month
|