Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Format Field Custom Date Format(on cross tab header)

Status
Not open for further replies.

dv10lv

Programmer
Jan 4, 2007
8
US
I have a crosstab field date it includes all the days in a month. Using format field Customize -> Ive formatted the field as Mon 01 (ie Day of Week Short, and day 01, no time, no month). What I have is:
Mon 01, Tue 02, Wed 03,..

What I need is Mo 01, Tu 02, We 03, ..

I need two char abbreviation for day of week instead of three that is the default.


 
Instead of using field formatting, go into the crosstab expert->select the column field ({table.date})->group options->options->customize group name->use a formula for group name->x+2 and enter:

left(totext({table.date},"MMM dd"),2)+" "+right(totext({table.date},"MMM dd"),2)

-LB
 

lbass (TechnicalUser) 9 Jan 07 17:43
wrote:
Instead of using field formatting, go into the crosstab expert->select the column field ({table.date})->group options->options->customize group name->use a formula for group name->x+2 and enter:

left(totext({table.date},"MMM dd"),2)+" "+right(totext({table.date},"MMM dd"),2)

********************************************************************************************************

Actual formula used on customize group name:
select DayOfWeek({Command.date})
case 1 : 'Su' +" "+right(totext({Command.date},"MMM dd"),2)
case 2 : 'Mo' +" "+right(totext({Command.date},"MMM dd"),2)
case 3 : 'Tu' +" "+right(totext({Command.date},"MMM dd"),2)
case 4 : 'We' +" "+right(totext({Command.date},"MMM dd"),2)
case 5 : 'Th' +" "+right(totext({Command.date},"MMM dd"),2)
case 6 : 'Fr' +" "+right(totext({Command.date},"MMM dd"),2)
case 7 : 'Sa' +" "+right(totext({Command.date},"MMM dd"),2)
 
Sorry, I missed the dayofweek bit. You could have used:

left(weekdayname(dayofweek({table.date})),2)+" "+right(totext({table.date},"MMM dd"),2)

-LB
 
You could also take lbass's firt post and just alter it abit to thi:

left(totext({table.date},"ddd dd"),2)+" "+right(totext({table.date},"ddd dd"),2)

~Brian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top