Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Modify Command SQL query help 1

Status
Not open for further replies.

Dausa67

Technical User
Oct 1, 2008
96
US
Well once again I need some one to come to my rescue.

I have the following SQL statement that I need to change.

select trim(ITMID) item_id,QTY
from ycsdtatst1.dcsilm
where majloc = '8'

This pulls a information in to a column in a crystal report. I need to pull an extra column that will pull information in to a column for majloc 5. I need them to be two seperate columns.

Thanks for any help you can offer

Clay
 
Just add to select

select trim(ITMID) item_id,QTY, majloc
from ycsdtatst1.dcsilm
where majloc = '8'

Ian
 
Thanks Ian, that worked.
I have another problem.
Can you tell me what the problem is with this formula?

if ( CurrentDate - {WIP_ORDER.DATE_COMPLETE_PLAN} ) < 0 then "Not Late"
else formula (CurrentDate - {WIP_ORDER.DATE_COMPLETE_PLAN})

I need to subtract current date from date complete and then if it is less than 0, change it to say Not late.

any suggestions?

Clay
 
YOu can not mix data types in If then else, you have string and number.

Try

if ( CurrentDate - {WIP_ORDER.DATE_COMPLETE_PLAN} ) < 0 then "Not Late"
else totext((CurrentDate - {WIP_ORDER.DATE_COMPLETE_PLAN}),0,"")

First argument sets no decimal, second sets no thousand separator.

Ian
 
Also

Try not to mix different questions in same post. Start a new post that way you will get best chance of a prompt answer. Respondents come from all over world so they come and go as time changes. Not all respondents look at questions with multipe replies as they will conclude problem is being solved.

Ian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top