Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Find rows with inv_dates
Message
 
 
À
01/05/2017 13:47:17
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
01650725
Message ID:
01650734
Vues:
55
>>>I have another brain freeze
>>>I know the beginning year and month and the ending year and month (all integers)
>>>I want to write a query that returns all rows with inv_dates between those months and years.
>>>All graciously accepted.
>>
>>In SQL 2014 and up
>>
>>select * from Invoices where inv_dates between datefromparts(yearfrom, monthfrom, 1) and eomonth(datefromparts(yearto, monthto,1))
>
>Thank you, Naomi.
>I'm using 2012

They actually were added in 2012, so you can use them.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform