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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Wrong Day Name using WeekDayName() 1

Status
Not open for further replies.

diane55

Programmer
Dec 14, 2004
20
0
0
US
I am running Crystal 10 on an ODBC database.

My question -
In the Crystal Report I am creating I have created a formula and placed it in the page header.

The formula is "weekdayname(dayofweek({tableName.columnName}))" The outcome of this formula is "Wednesday". The columnName (date) of evaluation is 02/22/2007 which would be Thursday.

Why am I getting Wednesday instead of Thursday? Any thoughts would be appreciated.

Thanks Diana
 
Curious why you wouldn't post the actual formula used?

And did you place tableName.columnName in the PAGE HEADER alongside to determine it's value, or make some assumptions?

-k
 
Formula: //{@ScheduleDt}:
weekdayname(dayofweek({JDGBLKTM.BLK_DT}))
Yes I did place the formula in the Page Header. That is how I know that the value that returns is Wednesday rather than Thurday - When I compile the report.

Thanks for looking.
D
 
What does compiling a report have to do with it?

CR 10 doesn't have a compiler.

You should place the DATE field in the page header...
I suggets this, and you prompty ignore and repeat that you placed the formula in the page header...

-k
 
Try
Code:
ToDate({tableName.columnName}, "ddd dd/MM/yyyy")
See what you get.

It's possible that one of your other commands is setting a non-standard beginning. Export > Report Definition would be a way to check, probably quicker than checking formula fields one by one.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Your formula in the page header will reflect the dayofweek for the first date on the page in the detail section, so you do need to add the date field to the page header as a check to see what date is being used in your formula.

-LB
 
lbass
Thanks for the reply.

In the page header I have
@schedDt
weekdayname(dayofweek({@currentDt}));
the above returns Friday 02/23/2007
So this is good.
Thanks again.
Diana
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top