DB2 Question

N

Nick

I am trying to run an automated job that grabs data every half hour from a
table. I am hosting this downloaded data in mySQL but the source is DB2. The
code for the query currently looks something like this:

SELECT
ABCDEF.PLAYERS
WHERE
ABCDEF.ENDDATTIM
BETWEEN
NOW() AND SUBTIME(NOW(), '0 0:30:0.000000')

Unfortunately this mySQL code (the SUBTIME())is not recognized by the DB2, I
was looking for an equivalent in DB2 and could not find anything online. Does
anyone have a suggestion?

Thank you. (I couldn't find anyone in DB2 forums to respond, hoping someone
here can help)
 
M

Michel Walsh

Well, seems you should ask in an mySQL newsgroup, this is an MS Access
newsgroup. Jet will use DateAdd( ), with a negative value, since Jet does
not have a DateSubtract( ). It will use

DateAdd("n", -30, Now( ) )

or simply:

Now( ) - #00:30:00#



Vanderghast, Access MVP
 
M

MGFoster

Nick said:
I am trying to run an automated job that grabs data every half hour from a
table. I am hosting this downloaded data in mySQL but the source is DB2. The
code for the query currently looks something like this:

SELECT
ABCDEF.PLAYERS
WHERE
ABCDEF.ENDDATTIM
BETWEEN
NOW() AND SUBTIME(NOW(), '0 0:30:0.000000')

Unfortunately this mySQL code (the SUBTIME())is not recognized by the DB2, I
was looking for an equivalent in DB2 and could not find anything online. Does
anyone have a suggestion?

Thank you. (I couldn't find anyone in DB2 forums to respond, hoping someone
here can help)

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

Here is a site that discusses DB2 time functions:

http://tinyurl.com/4uuw54

I don't know what SUBTIME() does, so I could not identify the
appropriate DB2 time function you would need.

P.S. I hope you put a FROM clause in that SQL statement when you send it
to the DB.
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
** Respond only to this newsgroup. I DO NOT respond to emails **

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

iQA+AwUBSNxUBoechKqOuFEgEQJeJgCaAtzF/MVkptnW7WRi+6ZGi2LvrB0Al2B8
M4sEf+M5gjSx7/EdS7pU6g4=
=qwly
-----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