OLE DB date filter

 7 Replies
 0 Subscribed to this topic
 22 Subscribed to this forum
Sort:
Author
Messages
Nabil
Veteran Member Send Private Message
Posts: 61
Veteran Member
Hello all,

I need to place a filter in my Command using OLE DB Query builder for the following:
BENEFIT.STOP-DATE equal date(1800,1,1)

or actually:

BENEFIT.STOP-DATE is Null

Does anyone know the syntax for Query builder to have this criteria? I want to report to only output records with a null BEN-STOP-DATE...

Thank you much,

FireGeek21
Veteran Member Send Private Message
Posts: 84
Veteran Member
Try the following:

BENEFIT.STOP-DATE = 00000000

There should be enough zeros for a 2 digit month, 2 digit day and a 4 digit year.

Good luck!

FireGeek
Ruma Malhotra
Veteran Member Send Private Message
Posts: 412
Veteran Member
Lawson stores the null dates in the format of 1/1/1700. The format should be the same as this date.

I have found queries to work when I specify a null date in this format.
John Henley
Send Private Message
Posts: 3355
1/1/1700 is only for some databases; others use 1/1/1800 and other flavors.

Regardless, when using OLEDB against Lawson, you are going thru IOS/DME/Data, etc. Not directly to database, so =00000000 should work as well as equal sign without anything. =
Thanks for using the LawsonGuru.com forums!
John
FireGeek21
Veteran Member Send Private Message
Posts: 84
Veteran Member
It is true Lawson stores null dates as 01/01/1700 however how you identify nulls in Crystal are different based on your connection and where you are identifying them.

Here is what I found if you are looking for NULL in a field use the following:

OLE:
Filter - BENEFIT.STOP-DATE = 00000000
Formula - isnull({BENEFIT.STOP-DATE})

ODBC:
Formula - Date(BENEFIT.STOP-DATE) = Date(1700, 01, 01)

Hope this helps.

FireGeek
FireGeek21
Veteran Member Send Private Message
Posts: 84
Veteran Member
John, thanks for this bit of information, "1/1/1700 is only for some databases; others use 1/1/1800 and other flavors." I thought 1800 was a typo!

FireGeek
John Henley
Send Private Message
Posts: 3355

Posted By FireGeek on 07/29/2010 01:34 PM
It is true Lawson stores null dates as 01/01/1700 however how you identify nulls in Crystal are different based on your connection and where you are identifying them.

Here is what I found if you are looking for NULL in a field use the following:

OLE:
Filter - BENEFIT.STOP-DATE = 00000000
Formula - isnull({BENEFIT.STOP-DATE})

ODBC:
Formula - Date(BENEFIT.STOP-DATE) = Date(1700, 01, 01)

Hope this helps.

FireGeek


The original question was how to filter on null dates using Lawson OLE DB, which would be part of the command string processed by Lawson -BEFORE- it gets to Crystal.
Thanks for using the LawsonGuru.com forums!
John
John Henley
Send Private Message
Posts: 3355

Posted By FireGeek on 07/29/2010 01:36 PM
John, thanks for this bit of information, "1/1/1700 is only for some databases; others use 1/1/1800 and other flavors." I thought 1800 was a typo!

FireGeek

https://www.lawsonguru.co...tore-NULL-Dates.aspx
Thanks for using the LawsonGuru.com forums!
John