User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the MS Access and FileMaker Pro section within the Web Development category of DaniWeb, a massive community of 425,968 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 1,636 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MS Access and FileMaker Pro advertiser: Programming Forums
Views: 1342 | Replies: 2
Reply
Join Date: Mar 2007
Posts: 17
Reputation: Robtyketto is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
Robtyketto Robtyketto is offline Offline
Newbie Poster

Help Access/Jet SQL: Date/time issues

  #1  
Mar 19th, 2008
Greetings,

I'm using Flash MX connecting to an MS Access database via JET.

I've stored dates using Flash/Jet into my database as 'dd/mm/yyyy hh:mm:ss' into a DATE/TIME field.

However I can't update because of the WHERE clause as I am not specifying the date correctly. I believe syntax wise I need to use # and specify it in american format mm/dd/yyyy hh:mm:ss.

I have the code below working :-

mdm.Database.MSAccess.runQuery("UPDATE UserOverallResults SET Results = 10 WHERE UserName = 'Rob' AND quizDate > #02/19/2008#");

When I add the time it complains and using the "=" clause it complains :-

mdm.Database.MSAccess.runQuery("UPDATE UserOverallResults SET Results = 10 WHERE UserName = 'Rob' AND quizDate = #02/19/2008 12:03:32# ");

Can anyone please assist, ive spent hours messing around with date/time formats, very confused.

Thanks
Rob W
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Mar 2007
Posts: 17
Reputation: Robtyketto is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
Robtyketto Robtyketto is offline Offline
Newbie Poster

Re: Access/Jet SQL: Date/time issues

  #2  
Mar 19th, 2008
After further testing it appears not to like the time format as the code below works

mdm.Database.MSAccess.runQuery("UPDATE UserOverallResults SET Results = 10 
WHERE UserName = 'Rob' AND quizDate = #19/02/2008#");

As soon as I add time (hh:mm:ss) it errors.
Reply With Quote  
Join Date: Dec 2004
Location: London or Slovakia
Posts: 2,453
Reputation: peter_budo is a jewel in the rough peter_budo is a jewel in the rough peter_budo is a jewel in the rough peter_budo is a jewel in the rough 
Rep Power: 11
Solved Threads: 296
Moderator
Featured Poster
peter_budo's Avatar
peter_budo peter_budo is offline Offline
Code tags enforcer

Re: Access/Jet SQL: Date/time issues

  #3  
Mar 22nd, 2008
Well, looks like you got your solution http://www.eggheadcafe.com/software/...headaches.aspx
Or isn't that you?
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)

If we helped you to solve your problem, answered your question please mark your post as SOLVED.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb MS Access and FileMaker Pro Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Other Threads in the MS Access and FileMaker Pro Forum

All times are GMT -4. The time now is 10:57 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC