Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 How do I query for current day?

Author  Topic 

chef423
Starting Member

15 Posts

Posted - 2014-09-21 : 18:32:23
SELECT c.cust_fullname AS Customer, c.cust_membership_id AS Account#, SUM(t.c_amount) AS ChargeTotal
FROM Transactions AS t
INNER JOIN Customers AS c ON t.s_ref_num = c.cust_id
where s_credit_tran_type = 'House Account' and b_cancel = 0
GROUP BY c.cust_fullname, c.cust_membership_id


I need this simple query to run automatically every night at 11:30pm, everyday, but only for the Current Day's business.

Any tips on how to achieve this?

My file will output to .CVS format for import into Quickbooks. I'd love to have it import directly INTO Quickbook's, but I am not at that level yet..

Thanks to anyone who is taking time to help.

Chris

ahmeds08
Aged Yak Warrior

737 Posts

Posted - 2014-09-22 : 04:54:58
you need to add a where clause to your query to filter current day records.
you can schedule the script through sql agent job to run daily at 11:30 pm.

Javeed Ahmed
Go to Top of Page
   

- Advertisement -