Question
Select records by date after first of next month
Hi
I have an asp app accessing a SQL Server db and am getting myself into a tangle over dates. I have a date field ValidFromDt (smalldatetime) and another date field ValidUntilDt which respectively define when a record is valid from and until. I want to select all records valid on the first of next month - i.e. were now in July so I want any whose 'valid from' date is now or any day up to 1 Aug but excluding those which expire before 1 Aug and also those whose valid from date is 2 Aug or later. Whatever month we're in, it is the first of next month I want to select up until.
Any suggestions much appreciated.
Thanks
TP
I have an asp app accessing a SQL Server db and am getting myself into a tangle over dates. I have a date field ValidFromDt (smalldatetime) and another date field ValidUntilDt which respectively define when a record is valid from and until. I want to select all records valid on the first of next month - i.e. were now in July so I want any whose 'valid from' date is now or any day up to 1 Aug but excluding those which expire before 1 Aug and also those whose valid from date is 2 Aug or later. Whatever month we're in, it is the first of next month I want to select up until.
Any suggestions much appreciated.
Thanks
TP
