Can this be done.

Results 1 to 3 of 3

Thread: Can this be done.

  1. #1
    Join Date
    Dec 1969

    Default Can this be done.

    SQL="SELECT CD FROM Store WHERE Purchase_Date LIKE #"&newtime&"%#"<BR>Now here&#039s the problem. My field Purchase_Date is a FULL date/time, meaning 9/18/00 4:45 PM. My newtime field is just a regular short date-9/18/00. I want to select the CD only where the dates match. However being that the two fields are different, I am trying to add a wildcard character (%) to the newtime. But no matter where or how, I try to put it there, it&#039s just not in the right place. Can it be done- a wildcard with a date? What am I missing here?

  2. #2
    iyyappan n iyer Guest

    Default RE: Can this be done.

    create a rs with out condition<BR>move to first record<BR><BR>&#039then loop thru all record<BR>Do until Rs.Eof<BR><BR>&#039extract date from datetime field<BR>&#039using date handler functions<BR>&#039compare it with short date value<BR>&#039if they are equal then <BR>&#039write record to user or do any other process u like<BR><BR><BR>Rs.MoveNext<BR>Loop

  3. #3
    Join Date
    Dec 1969

    Default Of coure it can!

    You basically need to get anything that happened on that day so...<BR><BR>SELECT CD FROM Store WHERE Purchase_Date between newtime and dateadd(dd,1,newtime)<BR><BR>i think this should be a lot easier/quicker than the other post.<BR><BR>

Posting Permissions

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