Re: sql syntax

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: John Vinson (jvinson_at_STOP_SPAM.WysardOfInfo.com)
Date: 12/10/04


Date: Fri, 10 Dec 2004 11:50:27 -0700

On Fri, 10 Dec 2004 07:45:05 -0800, "vincent"
<vincent@discussions.microsoft.com> wrote:

>yes that's it. the field of type string stores a value like this 04-NO-04 and
>i'd like to check if the record is 4 days older than the current date. what
>do you suggest? also can i simply add a numeric(i.e. 4 in this case) to a
>field of type date? thanks.

That's an odd date format! Is 04-JU-O4 in June or July? Any chance you
could convert this value to a true Date/Time?

No, you cannot add 4 to a string; but there is a function named
DateAdd which can add four days to a date:

DateAdd("d", 4, [datefield])

I'm not certain how you would be able to translate your nonstandard
date code to a true Date though, I've never seen a two-letter month
code in a date. If I knew the code-to-month translation I could write
you a small VBA function to translate, though.

                  John W. Vinson[MVP]
             Join the online Access Chats
        Tuesday 11am EDT - Thursday 3:30pm EDT
      http://community.compuserve.com/msdevapps



Relevant Pages