Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / February 2006

Tip: Looking for answers? Try searching our database.

Converting a date

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Nick - 08 Feb 2006 11:04 GMT
I have an input field which allows an input of DD/MM/YYYY, this then goes
into a VBA SQL query which converts the inputted numbers to MM/DD/YYYY.

How do I stop this?

Cheers Nick
Alex Dybenko - 08 Feb 2006 11:11 GMT
Hi,
perhaps you trying to convert it to date type?
try to operate with it like a string

Signature

Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com

>I have an input field which allows an input of DD/MM/YYYY, this then goes
> into a VBA SQL query which converts the inputted numbers to MM/DD/YYYY.
>
> How do I stop this?
>
> Cheers Nick
Nick - 08 Feb 2006 11:19 GMT
I need it to be a date type as the fields it is referencing are date type
fields.

Cheers  Nick

> Hi,
> perhaps you trying to convert it to date type?
[quoted text clipped - 6 lines]
> >
> > Cheers Nick
Douglas J Steele - 08 Feb 2006 12:09 GMT
Regardless of what your Regional Settings may be set to, Access expects
mm/dd/yyyy format in SQL statements. Simply explicitly format the input,
using Format([MyValue], "\#mm\/dd\/yyyy\#")

You might find it useful to read Allen Browne's "International Dates in
Access" at http://allenbrowne.com/ser-36.html or what I had in my September
2003 "Access Answers" column for Pinnacle Publication's "Smart Access"
newsletter. (The column and accompanying database can be downloaded for free
at http://www.accessmvp.com/djsteele/SmartAccess.html)

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

> I have an input field which allows an input of DD/MM/YYYY, this then goes
> into a VBA SQL query which converts the inputted numbers to MM/DD/YYYY.
>
> How do I stop this?
>
> Cheers Nick
Nick - 08 Feb 2006 14:20 GMT
Thanks, that has worked a treat

> Regardless of what your Regional Settings may be set to, Access expects
> mm/dd/yyyy format in SQL statements. Simply explicitly format the input,
[quoted text clipped - 12 lines]
> >
> > Cheers Nick
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.