A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

changing date format in a query



 
 
Thread Tools Display Modes
  #1  
Old May 24th, 2004, 05:22 PM
Elisa
external usenet poster
 
Posts: n/a
Default changing date format in a query

How do I change a date yyyymm to mm/dd/yyyy?
  #2  
Old May 24th, 2004, 05:36 PM
fredg
external usenet poster
 
Posts: n/a
Default 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  
Old May 24th, 2004, 05:41 PM
Allen Browne
external usenet poster
 
Posts: n/a
Default 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  
Old May 24th, 2004, 05:51 PM
external usenet poster
 
Posts: n/a
Default 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  
Old May 24th, 2004, 10:01 PM
John Vinson
external usenet poster
 
Posts: n/a
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:14 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.