Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Count of Matching Values on the Basis of Date

$
0
0

Hi,

I've data in two table. Table1 has two column named as of InvoiceDate (DateTime) & InvoiceNumbers (Numeric) and Table2 has 3 columns InvoiceDate (DateTime), InvoiceNumbers (Numeric) & CustomerName (varchar). 

Including this Table2 has multiple records of same InvoiceNumber.

I've data of 1 month and want to extract the data on following terms:

Count of All records where same InvoiceNumber is repeated in next 3 days. Like:

InvoiceNumber | Count

2345123 | 26

3454345 | 12

1234090 | 9

Please help me to do this?


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>