Home > database > Subtraction problem, SQL, time validity of batch query
Subtraction problem, SQL, time validity of batch query
Time:11-20
There is a table of a field for the period of validity field
Want to is to want to query data The query of data to be expired within 30 days from the day,
With the following statement Select * from AIC_Base_Card where DateDiff (dd, CA_EndDatetime, getdate ()) & lt;=30
But found within 30 days earlier than the day log but subtract data also found out, what method just query is greater than the current time after time to minus the expiration time and door group 30 days a way
consult
CodePudding user response:
query of data to be expired within 30 days from the day,
It depends on 30 days, how do you define, want accurate to seconds,
Advice into such, better performance (this column if added index, can be used to)