VB School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become a VB Expert!

Join 300,326 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 1,976 people online right now. Registration is fast and FREE... Join Now!




Change Show Word At Data Report

 

Change Show Word At Data Report

leang86

27 May, 2009 - 07:56 PM
Post #1

New D.I.C Head
*

Joined: 25 May, 2009
Posts: 26

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:

CODE

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.gif

User is offlineProfile CardPM
+Quote Post


paperclipmuffin

RE: Change Show Word At Data Report

27 May, 2009 - 09:20 PM
Post #2

WinWinWinWindows?
Group Icon

Joined: 16 Apr, 2009
Posts: 881



Thanked: 9 times
Dream Kudos: 400
My Contributions
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).
User is offlineProfile CardPM
+Quote Post

firebolt

RE: Change Show Word At Data Report

27 May, 2009 - 11:05 PM
Post #3

D.I.C Lover
Group Icon

Joined: 20 Feb, 2009
Posts: 5,462



Thanked: 75 times
Dream Kudos: 1675
My Contributions
Like so code.gif
User is offlineProfile CardPM
+Quote Post

thava

RE: Change Show Word At Data Report

28 May, 2009 - 12:51 AM
Post #4

D.I.C Addict
Group Icon

Joined: 17 Apr, 2007
Posts: 894



Thanked: 51 times
Dream Kudos: 75
My Contributions
is it going any thing wrong with your report mention it first
User is offlineProfile CardPM
+Quote Post

leang86

RE: Change Show Word At Data Report

28 May, 2009 - 05:57 PM
Post #5

New D.I.C Head
*

Joined: 25 May, 2009
Posts: 26

QUOTE(paperclipmuffin @ 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).


CODE

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?
User is offlineProfile CardPM
+Quote Post

June7

RE: Change Show Word At Data Report

28 May, 2009 - 08:55 PM
Post #6

D.I.C Regular
Group Icon

Joined: 9 Dec, 2008
Posts: 476



Thanked: 37 times
My Contributions
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.
CODE
= 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
User is offlineProfile CardPM
+Quote Post

leang86

RE: Change Show Word At Data Report

28 May, 2009 - 11:27 PM
Post #7

New D.I.C Head
*

Joined: 25 May, 2009
Posts: 26

QUOTE(June7 @ 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.
CODE
= 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.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/7/09 03:02PM

Live VB Help!

Be Social

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

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month