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!

Record Selection Date being passed as 12-30-1899

Status
Not open for further replies.

crogers111

Technical User
Jan 23, 2004
158
US
I've verified the datasource and at a loss as to why my date range is being altered to the default date of 12-30-1899 ? Hopefully I've provided enough info below:

CR XI
SQL OLE DB Connection.

Here is my record selection as seen in CR:

{Data.VenGroupNumber} = {?Group#}
and{Data.Vendor} = "ABC"
and {Data.CheckDate} in datetime(4/1/2006) to datetime(4/30/2006)
and {Data.ClaimStatus} in ["P"]


When I "Show SQL Query" under the Database Menu in CR:

WHERE "Data"."VenGroupNumber"='10060' AND "Data"."Vendor"='ABC' AND ("Data"."CheckDate">{ts '1899-12-30 00:00:06'} AND "Data"."CheckDate"<={ts '1899-12-30 00:02:52'}) AND "Data"."ClaimStatus"='P'
 
Try:

and {Data.CheckDate} in cdate(2006,1,1) to datetimecdate(2006,4,30)

If you just want last month, you might try:

and {Data.CheckDate} in lastfullmonth

-k
 
Ooops, that's:

and {Data.CheckDate} in cdate(2006,4,1) to datetimecdate(2006,4,30)
 
12-30-1899 is probably the zero date for your system. You were asking it to find the 2006th day of the 30th month of the year 4 AD.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
s,

with responses like this I need more info before I can properly thank you.

-what you were drinking
-how much you had
-where you got it

it's really hard to respond when your posts don't include all the information they should ;-)

jk. Your suggestion worked for what I needed.
Thanks again and thanks to Mad for the explanation.
c-

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top