If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
changing date format in a query
How do I change a date yyyymm to mm/dd/yyyy?
|
#2
|
|||
|
|||
changing date format in a query
On Mon, 24 May 2004 09:22:15 -0700, Elisa wrote:
How do I change a date yyyymm to mm/dd/yyyy? Is the [Date] field a Date/Time datatype? In a query? ColumnName:Format([DateField],"mm/dd/yyyy") -- Fred Please only reply to this newsgroup. I do not reply to personal email. |
#3
|
|||
|
|||
changing date format in a query
Go to the Windows Control Panel | Regional Options | Date.
Your date/time fields in Access will use the Short Date format you specified there, unless you set the Format property of the text boxes differently. -- Allen Browne - Microsoft MVP. Perth, Western Australia. Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "Elisa" wrote in message ... How do I change a date yyyymm to mm/dd/yyyy? |
#4
|
|||
|
|||
To FREDG changing date format in a query
Hi Fred. Thanks for your help.
In my query, I want to search between two date fields that are formatted dd/mm/yyyy using the date field that is formatted yyyymm. I know that I have to tell Access to use the month and year from yyyymm and add in 01 for the day but I don't know how. Can you enlighten me? -----Original Message----- On Mon, 24 May 2004 09:22:15 -0700, Elisa wrote: How do I change a date yyyymm to mm/dd/yyyy? Is the [Date] field a Date/Time datatype? In a query? ColumnName:Format([DateField],"mm/dd/yyyy") -- Fred Please only reply to this newsgroup. I do not reply to personal email. . |
#5
|
|||
|
|||
To FREDG changing date format in a query
On Mon, 24 May 2004 09:51:51 -0700,
wrote: Hi Fred. Thanks for your help. In my query, I want to search between two date fields that are formatted dd/mm/yyyy using the date field that is formatted yyyymm. The Format merely controls how the data is *displayed* - regardless of the format, a Date/Time value is stored as a Double Float number, a count of days and fractions of a day (times) since midnight, December 30, 1899. In other words - a date *is not a string*, and adding 01 won't work! I know that I have to tell Access to use the month and year from yyyymm and add in 01 for the day but I don't know how. Can you enlighten me? Try BETWEEN DateSerial(CInt(Left([Enter date yyyymm:], 4)), CInt(Right([Enter date yyyymm:], 2)), 1) AND DateSerial(CInt(Left([Enter date yyyymm:], 4)), CInt(Right([Enter date yyyymm:], 2)) + 1, 0) John W. Vinson[MVP] Come for live chats every Tuesday and Thursday http://go.compuserve.com/msdevapps?loc=us&access=public |
Thread Tools | |
Display Modes | |
|
|