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

HELP!!! Passing a Date from a HTML Text field into WF

Status
Not open for further replies.

MJPPaba

MIS
May 28, 2003
142
GB
I have a HTML Page with a Text field containing a date e.g.
30/05/2003.

This date field is to be used as a &DATEFROM variable. My problem is when it gets passed into Webfocus and is compared to the field of dates, the &DATEFROM field is recognised in A10 format or similar, however the date field is in the format HMDYY format.

Here is the code that I am using currenlty...

PRINT
ALLDATES
WHERE ( ALLDATES GE '&DATEFROM');

Cheers

Matthew Paba
 
Hi Matthew,

HTML field values are always passed on to webfocus as a string. So you'll have to convert the string format to Date format.

Regards
Eva
 
Hi Eva,

I had pretty much given up hope of passing through a date value. Thanks for your kind reply, you're a star.

Cheers

Matthew
 
Matthew,

Actually, you have TWO problems. The first is, you've specified your field's date format as MDYY, but the value you pass in is DMYY. So, the order of the components is different.

Second, when testing on a literal for a 'H' format field, you must use the DT function, to indicate that the value is a date-time constant. Thus, the test should look like this:

WHERE (ALLDATES GE DT(&DATEFROM))

This assumes that &DATEFROM is in a MDYY format, matching the format of ALLDATES.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top