HelpUpdateing table in C# using an OleDbType.Date parm in where cl

P

Patrick

I have an update where I specify the following:
string updateSQL = "update Perform " +
" set venueCd = ?, " +
" performanceDTTM = ?, " +
" performanceDesc = ?, " +
" lotteryPerformance = ?, " +
" lotteryAsgnComplete = ?, " +
" performHandicapLogic = ?, " +
" maxNumOfCompTks = ?, " +
" maxNumOfAdditionalTks = ?, " +
" costOfEachAddTk = ? " +
" where venueCd = ? and " +
" performanceDTTM = ?"

the column performanceDTTM is a datetime column in the access table. I am
passing in a parm that is of OleDbType.Date parm type. The value of the parm
matches the value in the table but the db does not find the row therefore my
update command is not updating the row. Any help would be greatlty
appreciated.
 
T

Tom Wickerath

Hi Patrick,

A date/time data type stores a number in the format XXXX.yyyy, where X is
the number of days since 12/30/1899 and yyyy is the fractional portion of a
day. So, for instance, 1:00 PM is represented as 13/24 = 0.54166 (repeating
6's). If the JET table includes time values that are not zero (midnight),
then an equals comparison with a date will likely fail. If your data includes
non-zero times of the day, try something like this:

" Date(performanceDTTM) = ?"


Just a guess on my part...

Tom Wickerath
Microsoft Access MVP
https://mvp.support.microsoft.com/profile/Tom
http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________
 

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