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!
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!
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!