- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to convert a Month, Year and day into a date
Hi guys,
My script has three fields: A month, day and Year. What I would like to do is to convert it into one variable called Date.
Does anyone have an idea?
I have used "Date(day&'/'&Month&'/'&Year) as Date" and it is not working properly.
Thanks in advance.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try the MakeDate() function
MakeDate(Year, Month, Day) as Date
UPDATE: In case Month is a text (Jan, Feb, Mar, .... etc), you can try this:
MakeDate(Year, Month(Date#(Month, 'MMM')), Day) as Date
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Use,
Makedate(Year,Mont,Date) as Date
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
Try like this
MakeDate(Year, Month, Day)
Please close the thread by marking correct answer & give likes if you like the post.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try the MakeDate() function
MakeDate(Year, Month, Day) as Date
UPDATE: In case Month is a text (Jan, Feb, Mar, .... etc), you can try this:
MakeDate(Year, Month(Date#(Month, 'MMM')), Day) as Date
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
may be this
makedate(Year,month) as Date
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
Suppose, if the Month is in Text, then try like this
MakeDate(Year, Month((Date#(Month, 'MMM'))), Day)
Please close the thread by marking correct answer & give likes if you like the post.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As all suggested use the makedate() function
MakeDate(Year, Month, Date) .....you need to keep the order of the inputs ..that is anything placed as 1 argument will be taken as the Year ,,2nd as the month ....and 3 as the date ...
if you give only year than the month and date will be defaulted to 01 &01
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Sunny.
Script was giving 0 values because Month variable was in text format.
Now it is working well.