Hello,
I am testing a database that is being changed from an access backend to an oracle backend (access frontend). I have found that is bombs out everywhere Dateserial is used, so I have been changing statements to format(), and it has been working until I changed this:
To this:
The date is entered into the TSOReceivedDate, but it's wrong.
Day-'10' Month-'DEC' Year-'2004' are entered as 9/12/1905
Can anyone offer any suggestions?
I am testing a database that is being changed from an access backend to an oracle backend (access frontend). I have found that is bombs out everywhere Dateserial is used, so I have been changing statements to format(), and it has been working until I changed this:
Code:
'Combine MonYr and Day fields to get TSOReceivedDate field
'DoCmd.Echo False, "Updating TSOReceivedDate field..."
'Set qd = db.CreateQueryDef("", "UPDATE [tblIncomingMessages]" & _
'"Set TSOReceivedDate = DateSerial([Year],IIf([Month]='JAN',1,IIf([Month]='FEB',2,IIf([Month]=
'MAR',3,IIf([Month]='APR',4,IIf([Month]='MAY',5,IIf([Month]='JUN',6,IIf
([Month]='JUL',7,IIf([Month]='AUG',8,IIf([Month]='SEP',9,IIf([Month]=
'OCT',10,IIf([Month]='NOV',11,IIf([Month]='DEC',12,0)))))))))))),[Day])
" & _
'"WHERE [tblIncomingMessages].TSOReceivedDate is null")
'qd.Execute
'qd.Close
Code:
'Combine MonYr and Day fields to get TSOReceivedDate field
DoCmd.Echo False, "Updating TSOReceivedDate field..."
strSql = "UPDATE [tblIncomingMessages] Set TSOReceivedDate = Format([Day], 'dd') & '/' & Format([Month], 'mm') & '/' & Format([Year], 'yyyy') WHERE [tblIncomingMessages].TSOReceivedDate is null"
DoCmd.RunSQL (strSql)
Day-'10' Month-'DEC' Year-'2004' are entered as 9/12/1905
Can anyone offer any suggestions?