Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

hi

i have a date column and want to extract quarter information from this. The date is is the YYYYMMDD format.

thanks

12 Replies
Not applicable
Author

Hey thank you so much. Its working fine.. ☺

hannan_t
Partner - Contributor III
Partner - Contributor III

Try this:

date(makedate(left(Date_Field,4),mid(Date_Field,5,2),Right(Date_Field,2)),'DD-MM-YYYY')

It will convert YYYYMMDD into DD-MM-YYYY and after that try applying ceil function.

tresesco
MVP
MVP

Try like:

Load     *,

              'Q' & Ceil(fMonth/3) as Quarter;

Load

          Mod(Month(Date#(YourDateField, 'YYYYMMDD')) -11, 12)+1        as fMonth,

           Month(Date#(YourDateField, 'YYYYMMDD')) as Month

From <>;

Here if you select Nov from Month field, it will associate '1' in the fMonth field.