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
 SQL Server 2012 Forums
 Transact-SQL (2012)
 looping and printing

Author  Topic 

junior6202
Starting Member

45 Posts

Posted - 2015-05-06 : 10:15:28
Hi all,

I have a question, I new to Tslq and trying to go through some records and print the invoice number if the date = 1900-01-01. Im trying to send an email alert with the invoice number if the date is generic. Any help would be greatly appreciated.

Kristen
Test

22859 Posts

Posted - 2015-05-06 : 10:23:41
Something like this perhaps?
SELECT TheInvoiceNumber
FROM TheInvoiceTable
WHERE TheInvoiceDate = '19000101'
OR TheInvoiceDate IS NULL
ORDER BY TheInvoiceNumber

Sorry, can't help with the email thing, but in principle it is possible to set up a scheduled task to send an email (e.g. whenever an invoice date of 1900-01-01 is added, or once a day with a list of any (I prefer the once a day/hour etc, otherwise if someone imports a spreadsheet with 1,000 rows all wrong!! you get 1,000 emails ] Its not something that I do though, so someone else can hopefully help with that.
Go to Top of Page
   

- Advertisement -