| | |
How to store & retrieve dates from MS access databse
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
![]() |
Hi,
It is always a Good Idea to store Dates in "Julian" style which is Numeric Long type. If stored in this way, whatever be the Local Regional setting of the computer u can get it back to required format. while storing use:
RST("DateField") = CLng(CDate(txtDate.Text))
To Retrieve Back use:
txtDate.Text = Format(RST("DateField"),"dd/MMM/yyyy")
But this has got its own draw back, Reporting gets difficult, in db all the records look like numbers. If using CR, u can create formula to convert it back to date...
Regards
Veena
It is always a Good Idea to store Dates in "Julian" style which is Numeric Long type. If stored in this way, whatever be the Local Regional setting of the computer u can get it back to required format. while storing use:
RST("DateField") = CLng(CDate(txtDate.Text))
To Retrieve Back use:
txtDate.Text = Format(RST("DateField"),"dd/MMM/yyyy")
But this has got its own draw back, Reporting gets difficult, in db all the records look like numbers. If using CR, u can create formula to convert it back to date...
Regards
Veena
![]() |
Similar Threads
- MS Access vs. MySQL (MS Access and FileMaker Pro)
- Store and Retrieve Information (Java)
- Access - Calendar Control (MS Access and FileMaker Pro)
- MS Access with a web front ent (MS Access and FileMaker Pro)
- how to retrieve the Microsoft Access DAtabase from the INternet using web services (VB.NET)
- Access denied to old data (Windows NT / 2000 / XP)
- Help needed with Dates and Access (ASP)
- wiki pages (PHP)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: help me pls~~ data report data section does not match data source
- Next Thread: VB6 Runtime error 7 Out of memory
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age append application basic beginner birth bmp calculator cd cells.find click client code college column component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report retrieve save search sendbyte sites sort sql sql2008 sqlserver subroutine table tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





