>today() does not work

G

G

When I use >Date() to get all records greater than today, I get the following
error message.
ODBC--call failed.
[IBM][CLI Driver][DB2]SQL0181N The string representation of a datetime value
is out of range SQLSTATE=22007 (#-181)

However, if I put in today's date manually, it works fine. Is this due to
references or something like that?

Thanks,
G
 
G

G

I was able to do a workaround like this:

keep: IIf([CRSE_STRT_DT]>=Date(),Yes,No)
criteria = yes

Evidently it is a communication issue between DB2 and ACCESS. If anyone
knows how to resolve the communication issue (i.e. through references or
something), then I would appreciate it greatly.
 
M

MGFoster

G said:
I was able to do a workaround like this:

keep: IIf([CRSE_STRT_DT]>=Date(),Yes,No)
criteria = yes

Evidently it is a communication issue between DB2 and ACCESS. If anyone
knows how to resolve the communication issue (i.e. through references or
something), then I would appreciate it greatly.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Just some guesses:

When you enter the date "manually," it shows up like this, in the
criteria box:

#4/29/2005#

So, how about using this in the criteria box:
"#" & Format(Date(), "mm/dd/yyyy") & "#"

This will return the date as a string value of

#4/29/2005#

=====

I'm pretty sure the following won't work, but just FYI - the format
works on SQL pass-thru queries.

You may want to use a date format that DB2 may understand. Try this:

CRSE_STRT_DT > Format(Date(),"'yyyymmdd'")

The Format() function will return a string of the date formatted like
this:

'20050429'

Most major SQL DB engines will convert that into their date data type.

Another format, the ISO standard, is this:

CRSE_STRT_DT > Format(Date(),"'yyyy-mm-dd'")

This will return the date formatted like this:

'2005-04-29'
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQnKcIYechKqOuFEgEQKP1QCg3Vz96KhYZPWF5XtN/pJmLodaRZQAnjtv
pkHwxdmRCB6tJy7IerMWGJ/c
=pu8N
-----END PGP SIGNATURE-----
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top