Focal Point
[SOLVED] Seems so simlpe! I want to use TODAY()

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/4907029496

November 23, 2020, 10:41 AM
RobertF
[SOLVED] Seems so simlpe! I want to use TODAY()
I have a column called: BillDate in my table. Its format is: HYYMDs.


I want a where condition:
WHERE BillDate <= TODAY[)

Do I define an item: TodaysDate using the today function? What would that look like?

No luck so far....

This message has been edited. Last edited by: FP Mod Chuck,


WebFOCUS 8206.08
Windows, All Outputs
November 23, 2020, 10:59 AM
FP Mod Chuck
Robert

This document may help you. https://techsupport.informatio...wbf/wbf_tcn_143.html


Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats
November 23, 2020, 12:34 PM
RobertF
thanks, I could no doubt go thru the support center...was thinking this was something folks do all the time and might have the syntax for me.


WebFOCUS 8206.08
Windows, All Outputs
November 23, 2020, 01:02 PM
FP Mod Chuck
I haven't done it with a full date/timestamp before or I would have provided an example.


Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats
November 23, 2020, 01:25 PM
RobertF
for some reason it wont let me format TODAY('HYYMD') for comparison.

This message has been edited. Last edited by: RobertF,


WebFOCUS 8206.08
Windows, All Outputs
November 23, 2020, 01:27 PM
RobertF
ehh...simplest things take too much time.

This message has been edited. Last edited by: RobertF,


WebFOCUS 8206.08
Windows, All Outputs
November 24, 2020, 05:55 AM
GamP
TODAY is for standard date fields. for HYYMDs fields you should use HGETC. That will give yoy the date and time in a HYYMDS field whcih you can use for whatever purpose..


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
November 24, 2020, 11:41 AM
dbeagan
You could try:
WHERE BillDate LE '&DATEYYMD 23:59:59.999'  



WebFOCUS 8.2.06
November 24, 2020, 03:40 PM
Waz
You could try
WHERE BillDate LE DT(&YYMD|23599999)

Can't remember if its a string or number


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

November 25, 2020, 01:31 PM
sh98110
I recently (sometime after our 82x upgrade) noticed that the following code will work:

WHERE RUN_DATE GE '&YYMD'

RUN_DATE defined as HYYMDS. The SQL that gets produced is:

WHERE
(T1."RUN_DATE" >= CAST('20201125 00:00:00' AS DATETIME));

This test is against SQL Server, but I am pretty sure it also works versus DB2. I am pretty sure that this did not always work, but it does now. Use of a literal, instead of the & variable, also works.

Nicely- the following code fails:

WHERE RUN_DATE GE '&MDYY'

the trace shows-

(FOC177) INVALID DATE CONSTANT: 11252020


WebFOCUS 8
Windows, All Outputs