If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > Need help with a sql statement used in Dreamweaver MX recordset

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-22-03, 21:32
MaggieDog MaggieDog is offline
Registered User
 
Join Date: Dec 2003
Location: Calgary Canada
Posts: 1
Need help with a sql statement used in Dreamweaver MX recordset

Here is the sql statement that I have right how that works.

SELECT DCount(""[Receipts]![receiptID]"",""Receipts"",""[UserName] = 'varUserName'"") AS Expr1, DSum(""[TransactionTbl]![TransPurchased]"",""[TransactionTbl]"",""[UserName] = 'varUserName'"") AS Expr2, [Expr2]-[Expr1] AS Expr3
FROM Receipts INNER JOIN TransactionTbl ON Receipts.UserName = TransactionTbl.UserName;

Table - "Receipt" has:
recieptID
UserName
receiptDate

Table - "TransactionTbl" has:
PurchasedDate
TransactionID
TransPurchased
UserName

Right now the sql count the total number of receipts and sums the total number of purchased and then
subtracts Expr1 from Expr2 to get remaining.

What I now need is a count of the total number of receipt greater than a receiptID of 200 and total number of purchases greater that a PurchasedDate of 01/11/2003.


Just cannot seem to make this work???

Thanks
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

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