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

Get full month name

Hello,

I'm runing below code it works fine.

SQLData:

//Concatenate (LatestMonth)

LOAD *,Month(DateTime) AS MonthName1

;

SQL SELECT *

FROM "Split Data".dbo."TempData_Date_JanToFeb"

Where

//DateTime >'2012-03-05 00:00:00.000'

DateTime > '$(vMaxDate)'

and datename(month,[datetime])='March'

But if i change it to

SQLData:

//Concatenate (LatestMonth)

LOAD *,Month(DateTime) AS MonthName1

;

SQL SELECT *

FROM "Split Data".dbo."TempData_Date_JanToFeb"

Where

//DateTime >'2012-03-05 00:00:00.000'

DateTime > '$(vMaxDate)'

and datename(month,[datetime])='$(vMonth)'

In variable vMonth name i'm getting name as Mar . I'm getting this from one of my previous loaded field by using peek function. How can i change it into fullname of month.

I'm using Month(fieldname) as MonthName

Let vMonth=Peek('MonthName');

1 Solution

Accepted Solutions
Not applicable
Author

use date(fieldname,'MMMM') instead of month(fieldname)

View solution in original post

10 Replies
Not applicable
Author

use date(fieldname,'MMMM') instead of month(fieldname)

Not applicable
Author

thanks to help me.

Not applicable
Author

i've a datefield with different number of dates. I'm catching the max date using peek function in a variable.

how can i get the next monthname in a variable. It should also be in the format March not as Mar

full name format i want to store in a variable.

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi

     use Text(Date(AddMonths(vMaxDateVariable,1),'MMM'))

Celambarasan

Not applicable
Author

Not only name of the month i want to store month number is seperate variable

Not applicable
Author

You can also try using this:  Dual(Month(fieldname),date(fieldname,'MMMM')

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     Yes you can use dual for this case.

     =Dual(Date(AddMonths(vMaxDateVariable,1),'MMMM'),Month(AddMonths(vMaxDateVariable,1)))

Use Variable name to get Month Name and use Num(Variable name) to get month number

Celambarasan

Not applicable
Author

it's working but when vMaxDateVariable is 12 i'm getting 2 instead of 1.

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     What Expression you used in this vMaxDateVariable?is it a date or only month?

Celambarasan