Gustav Brock
Gustav at cactus.dk
Wed Feb 14 13:36:40 CST 2007
Hi Mark Yes, you are confused. First, "Short Date" can be anything, it is localized. Thus, the strict US format expression I wrote about Second, as you write it, only "2/14/2007" would be returned. JET SQL has no way to know that is a date - it will think you are making two divisions. Thus, you must wrap it in hashmarks to make it string expression for a date value: "#2/14/2007#". /gustav >>> markamatte at hotmail.com 14-02-2007 20:25:35 >>> Thanks Gustav, I thought If I used Format(ArrestDT,"Short Date") it would be a date...and not a string? Am I confused? Thanks, Mark >From: "Gustav Brock" <Gustav at cactus.dk> >Reply-To: Access Developers discussion and problem >solving<accessd at databaseadvisors.com> >To: <accessd at databaseadvisors.com> >Subject: Re: [AccessD] Dates As Criteria >Date: Wed, 14 Feb 2007 20:12:18 +0100 > >Hi Mark > >As Lambert wrote, just using Format leaves you with a string not a date. >If you have to - and I can't see that's the case here - you must use a US >formatted string expression for a date value: > >SELECT Format([ArrestDT],"\#m\/d\/yyyy\#") .. > >/gustav