Formatting date query Column by week.

  • Thread starter Thread starter Raj
  • Start date Start date
R

Raj

I am using this function in a Cross Tab Format
([research_completed],"ww") to pull the weekly status for
employees. What I would like to do is have the last day
of the work week displayed at the top of the columns
instead of the number of the week. I hope this is
possible.
Thanks
 
Hi Raj,

Is "last day of work week" = Friday?

PIVOT [DateField]-(Weekday([DateField])-6)

If Saturday

PIVOT [DateField]-(Weekday([DateField])-7)

Please respond back if I have misunderstood.

Good luck,

Gary Walter
 
Gary,
Thank for the help but I am having a problem. I put the
code in the Criteria and first I got an error: "The
expression you entered has an invalid. (dot) or !
operator or invalid parentheses. I and parentheses on
both end of the formula and got this error "Undefined
function 'PIVOT' in expression"
Thanks.
Raj
-----Original Message-----
Hi Raj,

Is "last day of work week" = Friday?

PIVOT [DateField]-(Weekday([DateField])-6)

If Saturday

PIVOT [DateField]-(Weekday([DateField])-7)

Please respond back if I have misunderstood.

Good luck,

Gary Walter

I am using this function in a Cross Tab Format
([research_completed],"ww") to pull the weekly status for
employees. What I would like to do is have the last day
of the work week displayed at the top of the columns
instead of the number of the week. I hope this is
possible.
Thanks


.
 
Hi Raj,

I believe your Column Heading column
in design view would look like:

Field: Expr1: [research_completed]-(Weekday([research_completed])-6)
Table:
Total: Group By
Crosstab: Column Heading

If you go to SQL View of your query,
at the end of the stmt it would show:

PIVOT [research_completed]-(Weekday([research_completed])-6);


I thought you were grouping on the week of
[research_completed], but you wanted to
show the date for the Friday of each week
group as a column heading. I must have really
misunderstood if this was a criteria of sorts.

If I have misunderstood, please copy and paste
the SQL stmt from SQL View that you were using.
I will try to get it right.

Good luck,

Gary Walter

Raj said:
Thank for the help but I am having a problem. I put the
code in the Criteria and first I got an error: "The
expression you entered has an invalid. (dot) or !
operator or invalid parentheses. I and parentheses on
both end of the formula and got this error "Undefined
function 'PIVOT' in expression"
Thanks.
Raj
-----Original Message-----
Hi Raj,

Is "last day of work week" = Friday?

PIVOT [DateField]-(Weekday([DateField])-6)

If Saturday

PIVOT [DateField]-(Weekday([DateField])-7)

Please respond back if I have misunderstood.

Good luck,

Gary Walter

I am using this function in a Cross Tab Format
([research_completed],"ww") to pull the weekly status for
employees. What I would like to do is have the last day
of the work week displayed at the top of the columns
instead of the number of the week. I hope this is
possible.
Thanks


.
 
Gary,
It works.. You were correct, I put the expression in the
wrong area. I am a neophyte at doing queries.
Thank you!!
Raj
-----Original Message-----
Hi Raj,

I believe your Column Heading column
in design view would look like:

Field: Expr1: [research_completed]-(Weekday ([research_completed])-6)
Table:
Total: Group By
Crosstab: Column Heading

If you go to SQL View of your query,
at the end of the stmt it would show:

PIVOT [research_completed]-(Weekday ([research_completed])-6);


I thought you were grouping on the week of
[research_completed], but you wanted to
show the date for the Friday of each week
group as a column heading. I must have really
misunderstood if this was a criteria of sorts.

If I have misunderstood, please copy and paste
the SQL stmt from SQL View that you were using.
I will try to get it right.

Good luck,

Gary Walter

Raj said:
Thank for the help but I am having a problem. I put the
code in the Criteria and first I got an error: "The
expression you entered has an invalid. (dot) or !
operator or invalid parentheses. I and parentheses on
both end of the formula and got this error "Undefined
function 'PIVOT' in expression"
Thanks.
Raj
-----Original Message-----
Hi Raj,

Is "last day of work week" = Friday?

PIVOT [DateField]-(Weekday([DateField])-6)

If Saturday

PIVOT [DateField]-(Weekday([DateField])-7)

Please respond back if I have misunderstood.

Good luck,

Gary Walter


I am using this function in a Cross Tab Format
([research_completed],"ww") to pull the weekly
status
for
employees. What I would like to do is have the last day
of the work week displayed at the top of the columns
instead of the number of the week. I hope this is
possible.
Thanks



.


.
 
Back
Top