# Need Help soon with this querry!!!!!! PLZ PLZ

#### rajgoyal00

I am BRAND NEW to ACCESS. Have been working on it for a week and have learned a lot. I LOVE the software but not the fact that it isn't easy. By now I have 6 tables, 10 queries and 3 reports, Everything's working beautifully. (with maybe one fix I need to find the answer to) BUT I am stuck at this particular criteria. HELP PLZZZZ.

I have a Table "Lottery" which has 5 fields. "ID(Primary ID), Slot No., Ticket Amount, Ticket Number, Dateval". The purpose is to find Lottery sold every day.

Slot No. "We have 40 Solts, every slot holds a different Ticket"

Ticket Amount " Tickets have different \$ values ( some are \$1, \$2, \$3, \$5, or \$10)

Ticket Number " Each ticket has a serial no."

Dateval "Date"

Each Lottery pack is worth \$300 (So \$10 ticket would have 30, and \$1 ticket would have 300 tickets, \$2 would have 150 tickets and so on.)
To get what sold today,
I do:
"Today's ticket No. -- Yesterday's ticket No = No. of Tickets Sold"
then "No. of Tickets Sold X Ticket Amount = Tickets sold"

I do that for each box and Take a sum of all the "Tickets Sold" to Get "TOTAL TICKETS SOLD"

So Far:
A Table with 5 fields. "ID(Primary ID), Slot No., Ticket Amount, Ticket Number, Date"
A Query: Which has
1. Date
2. Slot No.
3. Ticket Number
4. Previous Ticket No "Previous Ticket Number: DLookUp("[Ticket Number]","[Lottery]","
[ID]=" & [ID]-1)" WHICH IS NOT GIVING ME WHAT I WANT

I need this query to give previous ticket no. for that Particular SOLT NO. and the previous date.

I AM STUCK, I thought I could do this query, and then another query that would do "No. of tickets sold" and then maybe another one to get the sum for that date.

PLEASE HELP.... ( Am in going in the right direction, is this a right way to structure this)
IF YES how to make it possible.......

THANKS