Date Field - New Problem

Results 1 to 4 of 4

Thread: Date Field - New Problem

  1. #1
    Nathan Masek Guest

    Default Date Field - New Problem

    I have a date field in my datebase.<BR>I want to test if some thing is less than 10 days old.<BR>Now my problem is that when I do this:<BR><BR>strdate = Date - 10<BR><BR>I get 12/24/00<BR><BR>but the dates in my database are formatted like this 2000-12-24<BR><BR>Is there any way I can still check the dates in my SQL statement?<BR><BR>Any help would be greatly appreciated.<BR><BR>- Thanks<BR>- Nathan Masek

  2. #2
    PJ Guest

    Default RE: Date Field - New Problem

    When you reference your date field in your query, refer to it with this: format(datefieldname,&#039mm/dd/yyyy&#039)<BR>instead of just the field name.

  3. #3
    Nathan Masek Guest

    Default RE: Date Field - New Problem

    Like This?<BR><BR>sql = "SELECT * FROM table WHERE format(DATE_IN, &#039mm/dd/yy&#039) &#062;= #" & strdate & "#"

  4. #4
    PJ Guest

    Default RE: Date Field - New Problem

    Yes. That should work for Access. Come back if your using SQL Server.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts