Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Access
3rdpartyusrgrp
access
activexcontrol
adp.sqlserver
commandbarsui
conversion
dataaccess.pages
developers.toolkitode
devtoolkits
externaldata
forms
formscoding
gettingstarted
internet
interopoledde
macros
modulescoding
modulesdaovba
modulesdaovba.ado
multiuser
odbcclientsvr
queries
replication
reports
security
setupconfig
tablesdbdesign
  
 
date: Wed, 1 Oct 2008 10:36:00 -0700,    group: microsoft.public.access.queries        back       


Date conversion   
I have a date in a mm/dd/yyyy format and I want to convert it to a yyyy/mm 
format that I can sort.  I tried doing Year([Order Date]) & "/" & 
Month([Order Date]), but that converts it to text.  I am ok with leaving out 
the / and using . if that would make it work better.  

Thoughts?
Thanks!
date: Wed, 1 Oct 2008 10:36:00 -0700   author:   PJFry

RE: Date conversion   
Found it.  

CDate(Year([Order Date]) & "/" & Month([Order Date]))


"PJFry" wrote:

> I have a date in a mm/dd/yyyy format and I want to convert it to a yyyy/mm 
> format that I can sort.  I tried doing Year([Order Date]) & "/" & 
> Month([Order Date]), but that converts it to text.  I am ok with leaving out 
> the / and using . if that would make it work better.  
> 
> Thoughts?
> Thanks!
date: Wed, 1 Oct 2008 10:41:02 -0700   author:   PJFry

Re: Date conversion   
Take a look at the Format() function.

Regards

Jeff Boyce
Microsoft Office/Access MVP

"PJFry"  wrote in message 
news:329EFFBC-1C23-4F67-A8BE-E06374709EFB@microsoft.com...
>I have a date in a mm/dd/yyyy format and I want to convert it to a yyyy/mm
> format that I can sort.  I tried doing Year([Order Date]) & "/" &
> Month([Order Date]), but that converts it to text.  I am ok with leaving 
> out
> the / and using . if that would make it work better.
>
> Thoughts?
> Thanks!
date: Wed, 1 Oct 2008 11:03:26 -0700   author:   Jeff Boyce

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us