Date processing with DB2

Forum related to DB2

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
MartinTeefy
Fresh Boarder
Fresh Boarder
Posts: 4
Joined: 24.11.2009, 17:17

Date processing with DB2

Post by MartinTeefy »

Hi,

I'd like to add DB2 as a supported database for my helpdesk system. 95% of the SQL statements are generic via the keys being numeric in the main but I have some date related questions:

When i do an insert or update to a table what is the equivalent to MSSQL system variables Getdate() or MySQL's Curdate()

What is the best way to Select data using a datetime field or the equivalent of either SQL statements:

MySQL:

SELECT Count(*) FROM AON_APPOINTMENTS WHERE AP_USER_ID = gCurrentAppointee & " AND DATE_FORMAT(AP_START_DATETIME,%Y-%m-%d) = '" & Format(eachDay, "YYYY-MM-DD") & "'"

SQLite:

SELECT Count(*) FROM AON_APPOINTMENTS WHERE AP_USER_ID =
gCurrentAppointee & " AND DATE(AP_START_DATETIME) = '" & _
Format(eachDay, "YYYY-MM-DD") & "'"

Any advice is much appreciated
Martin
Post Reply