Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2009
    Posts
    67

    Unanswered: How do I create this form

    I have table I have been changing but this is how the table is and I keep track Phobe cards sales that come in books of 50 0r 100 or 200 per pack. and each book has uniqoe serial number and number of each card for example book serial will be X123 and if it has 50 in pack each phone card will have the serial number and 01, 02, 03 to 50. I designed the table this way

    SaleDate BookSerNo EndingNo
    01/01/09 X12345 00
    01/02/09 X12345 05
    01/03/09 X12345 20
    01/04/09 X12345 30

    I want to enter these information every day so then I can run quesry that will give me each day's sales, but how do i design form that will show me yesterday's data so i can see which books are open so I can update the EndingNO. I hope I'm clear enough.

    Thanks

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    Try something like:
    Code:
    SELECT * FROM <PhoneBookTable> WHERE SaleDate = DateAdd("d"; -1, Now())
    Keep in mind that DateTime data types have a Time part, so you'll probably have to convert everything to date only before performing the comparison:

    Code:
    SELECT PhoneBookTable.* FROM PhoneBookTable WHERE (((DatePart("y",[SaleDate]))=DatePart("y",DateAdd("d",-1,Now()))));
    or:
    Code:
    SELECT PhoneBookTable.* FROM PhoneBookTable WHERE (((Format([SaleDate],"yyyy/mm/dd"))=Format(DateAdd("d",-1,Now()),"yyyy/mm/dd")));
    Have a nice day!

Posting Permissions

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