Hello,
I have a table with a date field. In query, I would like to convert the date
field like mm/dd/yyyy to just the year and month. what function do I put to
achieve this?
PS. if the format is yy-mmm (08-APR, 08-JAN), when I export the data to
Excel, I need it to recognize the date so when it sort, the 08-JAN goes
before 08-APR. Thanks
|
|
0
|
|
|
|
Reply
|
Utf
|
2/21/2008 2:56:01 PM |
|
Then you need the day, 1, for the day, if you want to SORT on real dates.
DateValue(myDate+1 -DatePart("d", myDate))
transform the date, pushing it to the first day of the same month, same
year.
For your report, you can FORMAT it with yy-mmm:
? Format( now, "yy-mmm" )
08-Feb
? DateValue(now +1 -DatePart("d", now))
2008.02.01 ' if you type the previous expression while in the month
of February 2008
' my default format, for date, is the ISO double
dot format: yyyy.mm.dd
Vanderghast, Access MVP
"Cam" <Cam@discussions.microsoft.com> wrote in message
news:E02711C3-6031-47AE-A0C9-31C52DE0CB14@microsoft.com...
> Hello,
>
> I have a table with a date field. In query, I would like to convert the
> date
> field like mm/dd/yyyy to just the year and month. what function do I put
> to
> achieve this?
>
> PS. if the format is yy-mmm (08-APR, 08-JAN), when I export the data to
> Excel, I need it to recognize the date so when it sort, the 08-JAN goes
> before 08-APR. Thanks
|
|
0
|
|
|
|
Reply
|
Michel
|
2/21/2008 3:04:54 PM
|
|
|
1 Replies
3480 Views
(page loaded in 0.002 seconds)
Similiar Articles: convert date field to month/year - microsoft.public.access.queries ...Hello, I have a table with a date field. In query, I would like to convert the date field like mm/dd/yyyy to just the year and month. what function ... Convert Month, Week, Year to date - microsoft.public.excel ...Office - Excel - Convert a full date into just a month ... yyyy"", week ""ww) field by w ... convert date field to month/year ... Convert Number of Month to Number of days ... Convert date to months - microsoft.public.access.queries ...convert date field to month/year - microsoft.public.access.queries ... Hello, I have a table with a date field. In query, I would like to convert the date field like mm/dd ... create a single date column from seperate month, day and year colu ...convert date field to month/year - microsoft.public.access.queries ... create a single date column from seperate month, day and year colu ... convert date ... to convert ... Convert linked text field to date and then filter - microsoft ...convert date field to month/year - microsoft.public.access.queries ... In query, I would like to convert the date field like mm/dd/yyyy to just ... Date range in months from month and year fields - microsoft.public ...Date range in months from month and year fields - microsoft.public ... In query, I would like to convert the date field like mm/dd/yyyy to just the year and month ... and ... Select all dates in month from month and year in text box ...Date range in months from month and year fields - microsoft.public ... ... Select all dates in month from month and year in text box ... Convert linked text field to ... Querying Date Field, Disregarding Year - microsoft.public.access ...create a single date column from seperate month, day and year colu ... convert date field to month/year - microsoft.public.access.queries ... Querying Date Field ... Convert Number of Month to Number of days - microsoft.public.excel ...convert date field to month/year - microsoft.public.access.queries ... Convert Number of Month to Number of days - microsoft.public.excel ... convert date field to month ... Convert Unix timestamp to Access 2003 data field - microsoft ...convert Unix Timestamp to Access 2003 date - microsoft.public ... convert date field to month/year - microsoft.public.access.queries ... Convert Unix timestamp to Access ... How to Convert a Date to a Month in Access | eHow.comHow to Convert a String Into a Date Format; How to Convert a Date to a Month & Year ... Extracting the month and date data from Access fields is done using the preset DatePart ... How to Convert a Date to a Month & Year | eHow.comHow to Convert a Date to a Month & Year. Dates are abbreviated ... How to Extract Month & Year Data From an Access Field. Extracting the month and date data from Access ... 8/1/2012 8:46:49 AM
|