Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Find rows with inv_dates
Message
 
À
01/05/2017 10:43:39
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
01650725
Message ID:
01650726
Vues:
76
This message has been marked as the solution to the initial question of the thread.
>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.
WHERE inv_dates 
  BETWEEN CONVERT(DATETIME,CAST(@fromyear AS VARCHAR(4))+'-'+CAST(@frommonth AS VARCHAR(2))+'-01',120) AND 
                  DATEADD(m,1,CONVERT(DATETIME,CAST(@toyear AS VARCHAR(4))+'-'+CAST(@tomonth AS VARCHAR(2))+'-01',120))-1
MartinaJ
"Navision is evil that needs to be erazed... to the ground"

Jabber: gorila@dione.zcu.cz
Jabber? Jabbim
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform