
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to Get Month Number in Script
Team,
I'm loading an Excel file in the script, and have figured out how to add a Month field calculated from the date, but it shows month name and my other data is month number. Is there a way to get the month number calculated from the date? I'm thinking it's probably easy, but I can't find the exact syntax.
Load ABC as [ABC Dashes],
SHPD_QTY,
Date(SHPD_DT, 'M/D/YY') as [Ship Date],
YEAR(Date(SHPD_DT,'M/D/YY')) as [Ship Yr],
MONTH(Date(SHPD_DT,'M/D/YY')) as [Ship Mo],
1001 as Site,
COUNTRY_CD,
TAC1_CITY,
TAC1_STATE,
TAC1_ZIP5 as [Zip Code]
FROM
(
Results in Jan, Feb, Mar, etc., but I am looking for 1,2,3,4,5,6,7,8,9,10,11,12..
Thanks,
Shelley
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Just wrap it in num().
Load ABC as [ABC Dashes],
SHPD_QTY,
Date(SHPD_DT, 'M/D/YY') as [Ship Date],
YEAR(Date(SHPD_DT,'M/D/YY')) as [Ship Yr],
num(MONTH(Date(SHPD_DT,'M/D/YY'))) as [Ship Mo],
1001 as Site,
COUNTRY_CD,
TAC1_CITY,
TAC1_STATE,
TAC1_ZIP5 as [Zip Code]
FROM
(

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Just wrap it in num().
Load ABC as [ABC Dashes],
SHPD_QTY,
Date(SHPD_DT, 'M/D/YY') as [Ship Date],
YEAR(Date(SHPD_DT,'M/D/YY')) as [Ship Yr],
num(MONTH(Date(SHPD_DT,'M/D/YY'))) as [Ship Mo],
1001 as Site,
COUNTRY_CD,
TAC1_CITY,
TAC1_STATE,
TAC1_ZIP5 as [Zip Code]
FROM
(

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Man, you guys are awesome. When will I ever have all this stuff figured out?!?!? Thanks!
