Reply
Programming with SQL in Access
Old 07-27-2007, 01:10 PM Programming with SQL in Access
Junior Talker

Posts: 1
Name: Alex
I am trying to write a very simple program to count a number of entries, using user specifyed variables in an Access database. I know essentially the code to do it, but things like variables and that elude me.

This is essentially the program i want to make, with things in brackets being userdefined and things in square brackets being variables.

Code:
[Item] = SELECT PurchaseItems.ItemCode FROM PurchaseItems WHERE PurchaseItems.Description = (Item Name)

[DateRange] = SELECT TicketHeader.Code FROM TicketHeader WHERE TicketHeader.Date BETWEEN (StartDate) AND (EndDate)

Output SELECT COUNT(*) AS TotalCount FROM TicketDetail WHERE TicketDetail.ItemCode = [Item] AND TicketDetail.HeaderCode = [DateRange]
so on the last line i want to count the numbe of entries in TicketDetail (a table in the database) where the ItemCode is equal to the (single) ItemCode i returned on the first line, and the HeaderCode is equal to one of the values in [DateRange] of which there will be many

Any help making this into a proper program, which i need to do soo, would be hugely appreciated
notquitehere188 is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Reply     « Reply to Programming with SQL in Access
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 5.11321 seconds with 12 queries