I have a DB table with the following columns
- PolicyNumber
- NextPremiumDate
- PremiumNumber
For each PolicyNumber
i have 5 NextPremiumDates
.
I want to display the 1st NextPremiumDate which is easy ...but i want to show the next NextPremiumDate
only after the last NextPremiumDate
has passed...How do i check if the last date has passed??
I mean if i have 5 dates in the table given above...how do i check if the 1st date has passed then show 2nd date ...if 2nd has passed show 3rd and so on.
SELECT Top 1 NextPremiumDate
FROM MyTable
where NextPremiumDate >= getdate()
ORDER BY NextPremiumDate ASC
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.