Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all articles
Browse latest Browse all 13329

SQL SELECT Query

$
0
0
Hi guys,

Looking for help with a SQL select query with several conditions, want to know if this is possible:

I have:

CDD
AmendedCDD
CompletionDate

(All short date format)

All in the same table "TblOrderDetails"

I want a query that displays any CDD that are within 7 days of the today's date (or when the query is run).

However, if CompletionDate has an entry, then the query doesn't display the result as "due".

Also, if AmendedCDD has an entry in it, then the query ignores "CDD" and compares the AmendedCDD and CompletionDate instead.

Any ideas?

Viewing all articles
Browse latest Browse all 13329

Trending Articles