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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can a prompt value be concatenated in Universe

Status
Not open for further replies.

Anu1284

Programmer
Sep 24, 2003
25
0
0
US
Hi,

My requirement is the user will be prompted for a year and based on the year, I need to concatenate it to the last date of the year (i.e., "12/31/" + prompt year) and fetch the corresponding record.

Can you please suggest a way to get this done.

Thanks,
Anu.
 
What's your database?

You should be able to do this by using a combination of concatenation and conversion from character to date.

It all depends on your database platform.

Steve Krandel
Knightsbridge Solutions
formerly BASE Consulting Group
 
Yes you can. Like Steve said it depends on your DB. If you are on Oracle you would do something like this..

Code:
TO_DATE('12/31/' || @Prompt('Enter Year','N',,Mono,Free),'MM/DD/YYYY')

If you are on DB2 then blom is the person.

Sri
 
The Database is DB2. When I include the filter condition as

1. table.field(date) <= date(@prompt('Enter the Report Year','A',,MONO,FREE) || '12-31').

I get the error as &quot;An unexcepted token <end of statement> is found following &quot;'&quot;.

I changed it to the following:

2. table.field(date) <= date(@prompt('Enter the Report Year','A',,MONO,FREE) + '12-31').
I get the same error message.

Any suggestions on this.
 
Why have you mentioned table.field(date)?? Shouldn't that be just table columnname. Is that how you specify in DB2. Anyway you have missed a - after the year. Maybe that could be the cause. Try this one

Code:
table.field(date) <= date(@prompt('Enter the Report Year','A',,MONO,FREE) || '-12-31').

Sri
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top