|
-
Apr 5th, 2005, 06:02 AM
#1
Thread Starter
Hyperactive Member
Dates in Access SQL
For all you british people out there, or people who have dates in the following format
dd/mm/yyyy
How do you insert the date into sql. For example I have a combo box which gives the user a list of dates, I then want to look up a value from the databse depending on the specidied date. Curretly I am converting the date as follows
VB Code:
Function americanisedate(englishdate As Date) As String
americandate = Mid(englishdate, 4, 2) & "/" & Mid(englishdate, 1, 2) & "/" & Mid(englishdate, 7, 4)
americanisedate = americandate
End Function
I just feel there must be a better way, as I understand dates are actually stotred in the database as number of seconds elapsed since 1900 (or some such).
Anyway hope somebody understands what I'm waffling about and can help.
-
Apr 5th, 2005, 09:36 AM
#2
Addicted Member
Re: Dates in Access SQL
VB Code:
Dim MyDate as Date
MyDate = Date()
MyDate = Format(MyDate,"dd/MM/YYYY")
or thereabouts.
HTH
if you fail to plan, you plan to fail
-
Apr 5th, 2005, 10:55 AM
#3
Re: Dates in Access SQL
Format(<date var>,"dd mmm yyyy") <--- Access useage
Format(<date var>,"mm/dd/yyyy") <--- any sql useage (american formatting)
Last edited by Ecniv; Apr 5th, 2005 at 11:01 AM.
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
-
Apr 6th, 2005, 10:02 AM
#4
Thread Starter
Hyperactive Member
Re: Dates in Access SQL
Thanks will give it a go.
Still makes me cross, is mean the British don't have an empire anymore, and we now have to follow one of are ex colonies standards.
Only jokes, without America we wouldn't have great TV shows like 24.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|