Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Nov 2002
    Location
    Mt. Olive, North Carolina, USA
    Posts
    170
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Dates and Text Fields (2000)

    I have a text field that could have a date or text filled in on each record. I see where I can use cdate to convert the 'date' text to a date. I then can use a query to select dates that are less than today. But I also want to select the records that have text in this field. How can I select the records that are less than today or have text in this text field?
    Thank you in advance.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Dates and Text Fields (2000)

    Does this do what you want?
    <code>
    SELECT *
    FROM [NameOfTable]
    WHERE IsDate([NameOfField])=True AND CDate([NameOfField])<Date() OR IsDate([NameOfField])=False;
    </code>
    Substitute the correct names for the table and for the relevant field.

  3. #3
    2 Star Lounger
    Join Date
    Nov 2002
    Location
    Mt. Olive, North Carolina, USA
    Posts
    170
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Re: Dates and Text Fields (2000)

    That is what I was looking for. Thank you.

Posting Permissions

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