Display Times as HH:MM in a Crosstab

D

Duncan Edment

Now that I have my Sum of a Sum Crosstab query working, I only have one
problem.

The Crosstab shows the time durations as decimals, as I would expect.
However, I need to show this in HH:MM format. For example, where a cell
contains the value 8.28194444444445, I need it to show 198:46. How can I
achieve this?

Thanks and regards

Duncan

--
Newsgroups are like one big sandbox that all of us
UseNet kiddies play in with peace & harmony.

Spammers, Cross-Posters, and Lamers are the
people that pee in our big sandbox.
 
J

John Vinson

Now that I have my Sum of a Sum Crosstab query working, I only have one
problem.

The Crosstab shows the time durations as decimals, as I would expect.
However, I need to show this in HH:MM format. For example, where a cell
contains the value 8.28194444444445, I need it to show 198:46. How can I
achieve this?

mm is actually Months, not miNutes... nn is minutes. But an hh format
will only run up to 24 hours.

Use an expression such as

[field] \ 24 & Format([field] \ 1440 MOD 60, ":00")

The \ is an integer divide operator.
 
D

Duncan Edment

John Vinson said:
Now that I have my Sum of a Sum Crosstab query working, I only have one
problem.

The Crosstab shows the time durations as decimals, as I would expect.
However, I need to show this in HH:MM format. For example, where a cell
contains the value 8.28194444444445, I need it to show 198:46. How can I
achieve this?

mm is actually Months, not miNutes... nn is minutes. But an hh format
will only run up to 24 hours.

Use an expression such as

[field] \ 24 & Format([field] \ 1440 MOD 60, ":00")

The \ is an integer divide operator.

John,

Thanks for the reply. I have one question--and maybe I'm being a bit thick
here--but where do I enter the expression you listed above?

Duncan

--
Newsgroups are like one big sandbox that all of us
UseNet kiddies play in with peace & harmony.

Spammers, Cross-Posters, and Lamers are the
people that pee in our big sandbox.
 
D

Duncan Edment

Duane,

It's a value.

Duncan

--
Newsgroups are like one big sandbox that all of us
UseNet kiddies play in with peace & harmony.

Spammers, Cross-Posters, and Lamers are the
people that pee in our big sandbox.
 
D

Duane Hookom

Use the expression thta John Vinson suggested in the control source of a
text box in the report or form. If this doesn't help, post your SQL. We
don't know if the value is a sum or average or first,...
 
J

John Vinson

Thanks for the reply. I have one question--and maybe I'm being a bit thick
here--but where do I enter the expression you listed above?

As a calculated field in the Query. You haven't posted the SQL of the
crosstab query nor am I sure where you want this value to appear in
the result so I can't be much more specific than that!
 
D

Duncan Edment

-----Original Message-----
above?

As a calculated field in the Query. You haven't posted the SQL of the
crosstab query nor am I sure where you want this value to appear in
the result so I can't be much more specific than that!



.

John,

I should have realised it would have made sense to post
the SQL of the Crosstab & Query.

The Crosstab SQL is:

PARAMETERS [Start Date] DateTime, [End Date] DateTime;
TRANSFORM Sum(qryWorkloadSum.[Sum Of ProjectDuartion]) AS
[SumOfSum Of ProjectDuartion]
SELECT qryWorkloadSum.fldProjectDescription, Sum
(qryWorkloadSum.[Sum Of ProjectDuartion]) AS [Total Of Sum
Of ProjectDuartion]
FROM qryWorkloadSum
WHERE (((qryWorkloadSum.fldDateWorked) Between [Start
Date] And [End Date]))
GROUP BY qryWorkloadSum.fldProjectDescription
PIVOT qryWorkloadSum.fldEmployeeName;

Whilst the SQL of the Query on which the Crosstab is based
is:

SELECT DISTINCTROW qryWorkload.fldProjectDescription,
qryWorkload.fldEmployeeName, qryWorkload.fldDateWorked, Sum
(qryWorkload.ProjectDuartion) AS [Sum Of ProjectDuartion]
FROM qryWorkload
GROUP BY qryWorkload.fldProjectDescription,
qryWorkload.fldEmployeeName, qryWorkload.fldDateWorked;


The SQL for the Query qryWorkload is:

SELECT tblProjects.fldProjectDescription,
tblEmployee.fldEmployeeName, tblTimeSheet.fldDateWorked,
Sum([fldEndTime]-[fldStartTime]) AS ProjectDuartion,
tblTimeSheet.fldStartTime, tblTimeSheet.fldEndTime,
tblTimeSheet.fldEmployeeID, tblTimeSheet.fldProjectID
FROM tblProjects INNER JOIN (tblEmployee INNER JOIN
tblTimeSheet ON tblEmployee.fldEmployeeID =
tblTimeSheet.fldEmployeeID) ON tblProjects.fldProjectID =
tblTimeSheet.fldProjectID
GROUP BY tblProjects.fldProjectDescription,
tblEmployee.fldEmployeeName, tblTimeSheet.fldDateWorked,
tblTimeSheet.fldStartTime, tblTimeSheet.fldEndTime,
tblTimeSheet.fldEmployeeID, tblTimeSheet.fldProjectID;


What I want to do is, in the Crosstab view, display the
times in the format HH:NN, rather than the decimal format
they are currently in. You suggested using the expression:

[field] \ 24 & Format([field] \ 1440 MOD 60, ":00")

However, I am unclear as to whether this should be placed
in the Crosstab query, or the query that the Crosstab is
based upon.

Also, are you suggesting that the calculated field above
replace the value field that is in the Crosstab?

Regards

Duncan
 
D

Duane Hookom

Try this:
TRANSFORM Sum([Sum Of ProjectDuartion])\24 & Format(Sum([Sum Of
ProjectDuartion]) \ 1440 MOD 60, ":00") AS
[SumOfSum Of ProjectDuartion]
--
Duane Hookom
MS Access MVP


Duncan Edment said:
-----Original Message-----
above?

As a calculated field in the Query. You haven't posted the SQL of the
crosstab query nor am I sure where you want this value to appear in
the result so I can't be much more specific than that!



.

John,

I should have realised it would have made sense to post
the SQL of the Crosstab & Query.

The Crosstab SQL is:

PARAMETERS [Start Date] DateTime, [End Date] DateTime;
TRANSFORM Sum(qryWorkloadSum.[Sum Of ProjectDuartion]) AS
[SumOfSum Of ProjectDuartion]
SELECT qryWorkloadSum.fldProjectDescription, Sum
(qryWorkloadSum.[Sum Of ProjectDuartion]) AS [Total Of Sum
Of ProjectDuartion]
FROM qryWorkloadSum
WHERE (((qryWorkloadSum.fldDateWorked) Between [Start
Date] And [End Date]))
GROUP BY qryWorkloadSum.fldProjectDescription
PIVOT qryWorkloadSum.fldEmployeeName;

Whilst the SQL of the Query on which the Crosstab is based
is:

SELECT DISTINCTROW qryWorkload.fldProjectDescription,
qryWorkload.fldEmployeeName, qryWorkload.fldDateWorked, Sum
(qryWorkload.ProjectDuartion) AS [Sum Of ProjectDuartion]
FROM qryWorkload
GROUP BY qryWorkload.fldProjectDescription,
qryWorkload.fldEmployeeName, qryWorkload.fldDateWorked;


The SQL for the Query qryWorkload is:

SELECT tblProjects.fldProjectDescription,
tblEmployee.fldEmployeeName, tblTimeSheet.fldDateWorked,
Sum([fldEndTime]-[fldStartTime]) AS ProjectDuartion,
tblTimeSheet.fldStartTime, tblTimeSheet.fldEndTime,
tblTimeSheet.fldEmployeeID, tblTimeSheet.fldProjectID
FROM tblProjects INNER JOIN (tblEmployee INNER JOIN
tblTimeSheet ON tblEmployee.fldEmployeeID =
tblTimeSheet.fldEmployeeID) ON tblProjects.fldProjectID =
tblTimeSheet.fldProjectID
GROUP BY tblProjects.fldProjectDescription,
tblEmployee.fldEmployeeName, tblTimeSheet.fldDateWorked,
tblTimeSheet.fldStartTime, tblTimeSheet.fldEndTime,
tblTimeSheet.fldEmployeeID, tblTimeSheet.fldProjectID;


What I want to do is, in the Crosstab view, display the
times in the format HH:NN, rather than the decimal format
they are currently in. You suggested using the expression:

[field] \ 24 & Format([field] \ 1440 MOD 60, ":00")

However, I am unclear as to whether this should be placed
in the Crosstab query, or the query that the Crosstab is
based upon.

Also, are you suggesting that the calculated field above
replace the value field that is in the Crosstab?

Regards

Duncan
 
J

John Vinson

[field] \ 24 & Format([field] \ 1440 MOD 60, ":00")

However, I am unclear as to whether this should be placed
in the Crosstab query, or the query that the Crosstab is
based upon.

The Crosstab query - since you're trying to sum a numeric value, and
this expression will return a text string. Something like

PARAMETERS [Start Date] DateTime, [End Date] DateTime;
TRANSFORM (Sum(qryWorkloadSum.[Sum Of ProjectDuartion])\24
& Format(Sum(qryWorkloadSum.[Sum Of ProjectDuartion]) \ 1440 MOD 60,
":00:)) AS [SumOfSum Of ProjectDuartion]...

Untested air code... and I'm not really a crosstab whiz so you may
need to experiment with it!
 
D

Duncan Edment

Duane,

Thanks for the reply.

I've tried your suggestion however, the Crosstab now displays all time
entries under each employee as "0:00"!

All I've done is replaced the original TRANSFORM statement, with your
suggested one. I've even tried prefixing the [Sum Of ProjectDuration]
entries with qryWorkloadSum., however it still does not work.

Any ideas?

Thanks & regards

Duncan

--
Newsgroups are like one big sandbox that all of us
UseNet kiddies play in with peace & harmony.

Spammers, Cross-Posters, and Lamers are the
people that pee in our big sandbox.

Duane Hookom said:
Try this:
TRANSFORM Sum([Sum Of ProjectDuartion])\24 & Format(Sum([Sum Of
ProjectDuartion]) \ 1440 MOD 60, ":00") AS
[SumOfSum Of ProjectDuartion]
--
Duane Hookom
MS Access MVP


Duncan Edment said:
-----Original Message-----
On Sun, 8 Feb 2004 23:07:06 -0000, "Duncan Edment"

Thanks for the reply. I have one question--and maybe I'm being a bit thick
here--but where do I enter the expression you listed above?

As a calculated field in the Query. You haven't posted the SQL of the
crosstab query nor am I sure where you want this value to appear in
the result so I can't be much more specific than that!



.

John,

I should have realised it would have made sense to post
the SQL of the Crosstab & Query.

The Crosstab SQL is:

PARAMETERS [Start Date] DateTime, [End Date] DateTime;
TRANSFORM Sum(qryWorkloadSum.[Sum Of ProjectDuartion]) AS
[SumOfSum Of ProjectDuartion]
SELECT qryWorkloadSum.fldProjectDescription, Sum
(qryWorkloadSum.[Sum Of ProjectDuartion]) AS [Total Of Sum
Of ProjectDuartion]
FROM qryWorkloadSum
WHERE (((qryWorkloadSum.fldDateWorked) Between [Start
Date] And [End Date]))
GROUP BY qryWorkloadSum.fldProjectDescription
PIVOT qryWorkloadSum.fldEmployeeName;

Whilst the SQL of the Query on which the Crosstab is based
is:

SELECT DISTINCTROW qryWorkload.fldProjectDescription,
qryWorkload.fldEmployeeName, qryWorkload.fldDateWorked, Sum
(qryWorkload.ProjectDuartion) AS [Sum Of ProjectDuartion]
FROM qryWorkload
GROUP BY qryWorkload.fldProjectDescription,
qryWorkload.fldEmployeeName, qryWorkload.fldDateWorked;


The SQL for the Query qryWorkload is:

SELECT tblProjects.fldProjectDescription,
tblEmployee.fldEmployeeName, tblTimeSheet.fldDateWorked,
Sum([fldEndTime]-[fldStartTime]) AS ProjectDuartion,
tblTimeSheet.fldStartTime, tblTimeSheet.fldEndTime,
tblTimeSheet.fldEmployeeID, tblTimeSheet.fldProjectID
FROM tblProjects INNER JOIN (tblEmployee INNER JOIN
tblTimeSheet ON tblEmployee.fldEmployeeID =
tblTimeSheet.fldEmployeeID) ON tblProjects.fldProjectID =
tblTimeSheet.fldProjectID
GROUP BY tblProjects.fldProjectDescription,
tblEmployee.fldEmployeeName, tblTimeSheet.fldDateWorked,
tblTimeSheet.fldStartTime, tblTimeSheet.fldEndTime,
tblTimeSheet.fldEmployeeID, tblTimeSheet.fldProjectID;


What I want to do is, in the Crosstab view, display the
times in the format HH:NN, rather than the decimal format
they are currently in. You suggested using the expression:

[field] \ 24 & Format([field] \ 1440 MOD 60, ":00")

However, I am unclear as to whether this should be placed
in the Crosstab query, or the query that the Crosstab is
based upon.

Also, are you suggesting that the calculated field above
replace the value field that is in the Crosstab?

Regards

Duncan
 
D

Duane Hookom

Paste your modified SQL into a reply.

--
Duane Hookom
Microsoft Access MVP


Duncan Edment said:
Duane,

Thanks for the reply.

I've tried your suggestion however, the Crosstab now displays all time
entries under each employee as "0:00"!

All I've done is replaced the original TRANSFORM statement, with your
suggested one. I've even tried prefixing the [Sum Of ProjectDuration]
entries with qryWorkloadSum., however it still does not work.

Any ideas?

Thanks & regards

Duncan

--
Newsgroups are like one big sandbox that all of us
UseNet kiddies play in with peace & harmony.

Spammers, Cross-Posters, and Lamers are the
people that pee in our big sandbox.

Duane Hookom said:
Try this:
TRANSFORM Sum([Sum Of ProjectDuartion])\24 & Format(Sum([Sum Of
ProjectDuartion]) \ 1440 MOD 60, ":00") AS
[SumOfSum Of ProjectDuartion]
--
Duane Hookom
MS Access MVP


Duncan Edment said:
-----Original Message-----
On Sun, 8 Feb 2004 23:07:06 -0000, "Duncan Edment"

Thanks for the reply. I have one question--and maybe
I'm being a bit thick
here--but where do I enter the expression you listed
above?

As a calculated field in the Query. You haven't posted
the SQL of the
crosstab query nor am I sure where you want this value to
appear in
the result so I can't be much more specific than that!



.


John,

I should have realised it would have made sense to post
the SQL of the Crosstab & Query.

The Crosstab SQL is:

PARAMETERS [Start Date] DateTime, [End Date] DateTime;
TRANSFORM Sum(qryWorkloadSum.[Sum Of ProjectDuartion]) AS
[SumOfSum Of ProjectDuartion]
SELECT qryWorkloadSum.fldProjectDescription, Sum
(qryWorkloadSum.[Sum Of ProjectDuartion]) AS [Total Of Sum
Of ProjectDuartion]
FROM qryWorkloadSum
WHERE (((qryWorkloadSum.fldDateWorked) Between [Start
Date] And [End Date]))
GROUP BY qryWorkloadSum.fldProjectDescription
PIVOT qryWorkloadSum.fldEmployeeName;

Whilst the SQL of the Query on which the Crosstab is based
is:

SELECT DISTINCTROW qryWorkload.fldProjectDescription,
qryWorkload.fldEmployeeName, qryWorkload.fldDateWorked, Sum
(qryWorkload.ProjectDuartion) AS [Sum Of ProjectDuartion]
FROM qryWorkload
GROUP BY qryWorkload.fldProjectDescription,
qryWorkload.fldEmployeeName, qryWorkload.fldDateWorked;


The SQL for the Query qryWorkload is:

SELECT tblProjects.fldProjectDescription,
tblEmployee.fldEmployeeName, tblTimeSheet.fldDateWorked,
Sum([fldEndTime]-[fldStartTime]) AS ProjectDuartion,
tblTimeSheet.fldStartTime, tblTimeSheet.fldEndTime,
tblTimeSheet.fldEmployeeID, tblTimeSheet.fldProjectID
FROM tblProjects INNER JOIN (tblEmployee INNER JOIN
tblTimeSheet ON tblEmployee.fldEmployeeID =
tblTimeSheet.fldEmployeeID) ON tblProjects.fldProjectID =
tblTimeSheet.fldProjectID
GROUP BY tblProjects.fldProjectDescription,
tblEmployee.fldEmployeeName, tblTimeSheet.fldDateWorked,
tblTimeSheet.fldStartTime, tblTimeSheet.fldEndTime,
tblTimeSheet.fldEmployeeID, tblTimeSheet.fldProjectID;


What I want to do is, in the Crosstab view, display the
times in the format HH:NN, rather than the decimal format
they are currently in. You suggested using the expression:

[field] \ 24 & Format([field] \ 1440 MOD 60, ":00")

However, I am unclear as to whether this should be placed
in the Crosstab query, or the query that the Crosstab is
based upon.

Also, are you suggesting that the calculated field above
replace the value field that is in the Crosstab?

Regards

Duncan
 
D

Duncan Edment

Duane,

Modified SQL below:

PARAMETERS [Start Date?] DateTime, [End Date?] DateTime;
TRANSFORM Sum(qryWorkloadSum.[Sum Of ProjectDuartion])\24 &
Format(Sum(qryWorkloadSum.[Sum Of ProjectDuartion])\1440 Mod 60,":00") AS
Duration
SELECT qryWorkloadSum.fldProjectDescription AS Project,
Sum(qryWorkloadSum.[Sum Of ProjectDuartion]) AS [Sum Of Duartions]
FROM qryWorkloadSum
WHERE (((qryWorkloadSum.fldDateWorked) Between [Start Date?] And [End
Date?]))
GROUP BY qryWorkloadSum.fldProjectDescription
PIVOT qryWorkloadSum.fldEmployeeName;


--
Newsgroups are like one big sandbox that all of us
UseNet kiddies play in with peace & harmony.

Spammers, Cross-Posters, and Lamers are the
people that pee in our big sandbox.

Duane Hookom said:
Paste your modified SQL into a reply.

--
Duane Hookom
Microsoft Access MVP


Duncan Edment said:
Duane,

Thanks for the reply.

I've tried your suggestion however, the Crosstab now displays all time
entries under each employee as "0:00"!

All I've done is replaced the original TRANSFORM statement, with your
suggested one. I've even tried prefixing the [Sum Of ProjectDuration]
entries with qryWorkloadSum., however it still does not work.

Any ideas?

Thanks & regards

Duncan

--
Newsgroups are like one big sandbox that all of us
UseNet kiddies play in with peace & harmony.

Spammers, Cross-Posters, and Lamers are the
people that pee in our big sandbox.

Duane Hookom said:
Try this:
TRANSFORM Sum([Sum Of ProjectDuartion])\24 & Format(Sum([Sum Of
ProjectDuartion]) \ 1440 MOD 60, ":00") AS
[SumOfSum Of ProjectDuartion]
--
Duane Hookom
MS Access MVP


message -----Original Message-----
On Sun, 8 Feb 2004 23:07:06 -0000, "Duncan Edment"

Thanks for the reply. I have one question--and maybe
I'm being a bit thick
here--but where do I enter the expression you listed
above?

As a calculated field in the Query. You haven't posted
the SQL of the
crosstab query nor am I sure where you want this value to
appear in
the result so I can't be much more specific than that!



.


John,

I should have realised it would have made sense to post
the SQL of the Crosstab & Query.

The Crosstab SQL is:

PARAMETERS [Start Date] DateTime, [End Date] DateTime;
TRANSFORM Sum(qryWorkloadSum.[Sum Of ProjectDuartion]) AS
[SumOfSum Of ProjectDuartion]
SELECT qryWorkloadSum.fldProjectDescription, Sum
(qryWorkloadSum.[Sum Of ProjectDuartion]) AS [Total Of Sum
Of ProjectDuartion]
FROM qryWorkloadSum
WHERE (((qryWorkloadSum.fldDateWorked) Between [Start
Date] And [End Date]))
GROUP BY qryWorkloadSum.fldProjectDescription
PIVOT qryWorkloadSum.fldEmployeeName;

Whilst the SQL of the Query on which the Crosstab is based
is:

SELECT DISTINCTROW qryWorkload.fldProjectDescription,
qryWorkload.fldEmployeeName, qryWorkload.fldDateWorked, Sum
(qryWorkload.ProjectDuartion) AS [Sum Of ProjectDuartion]
FROM qryWorkload
GROUP BY qryWorkload.fldProjectDescription,
qryWorkload.fldEmployeeName, qryWorkload.fldDateWorked;


The SQL for the Query qryWorkload is:

SELECT tblProjects.fldProjectDescription,
tblEmployee.fldEmployeeName, tblTimeSheet.fldDateWorked,
Sum([fldEndTime]-[fldStartTime]) AS ProjectDuartion,
tblTimeSheet.fldStartTime, tblTimeSheet.fldEndTime,
tblTimeSheet.fldEmployeeID, tblTimeSheet.fldProjectID
FROM tblProjects INNER JOIN (tblEmployee INNER JOIN
tblTimeSheet ON tblEmployee.fldEmployeeID =
tblTimeSheet.fldEmployeeID) ON tblProjects.fldProjectID =
tblTimeSheet.fldProjectID
GROUP BY tblProjects.fldProjectDescription,
tblEmployee.fldEmployeeName, tblTimeSheet.fldDateWorked,
tblTimeSheet.fldStartTime, tblTimeSheet.fldEndTime,
tblTimeSheet.fldEmployeeID, tblTimeSheet.fldProjectID;


What I want to do is, in the Crosstab view, display the
times in the format HH:NN, rather than the decimal format
they are currently in. You suggested using the expression:

[field] \ 24 & Format([field] \ 1440 MOD 60, ":00")

However, I am unclear as to whether this should be placed
in the Crosstab query, or the query that the Crosstab is
based upon.

Also, are you suggesting that the calculated field above
replace the value field that is in the Crosstab?

Regards

Duncan
 
D

Duane Hookom

Are you getting any total in the [Sum Of Duartions] column?

--
Duane Hookom
MS Access MVP


Duncan Edment said:
Duane,

Modified SQL below:

PARAMETERS [Start Date?] DateTime, [End Date?] DateTime;
TRANSFORM Sum(qryWorkloadSum.[Sum Of ProjectDuartion])\24 &
Format(Sum(qryWorkloadSum.[Sum Of ProjectDuartion])\1440 Mod 60,":00") AS
Duration
SELECT qryWorkloadSum.fldProjectDescription AS Project,
Sum(qryWorkloadSum.[Sum Of ProjectDuartion]) AS [Sum Of Duartions]
FROM qryWorkloadSum
WHERE (((qryWorkloadSum.fldDateWorked) Between [Start Date?] And [End
Date?]))
GROUP BY qryWorkloadSum.fldProjectDescription
PIVOT qryWorkloadSum.fldEmployeeName;


--
Newsgroups are like one big sandbox that all of us
UseNet kiddies play in with peace & harmony.

Spammers, Cross-Posters, and Lamers are the
people that pee in our big sandbox.

Duane Hookom said:
Paste your modified SQL into a reply.

--
Duane Hookom
Microsoft Access MVP


Duncan Edment said:
Duane,

Thanks for the reply.

I've tried your suggestion however, the Crosstab now displays all time
entries under each employee as "0:00"!

All I've done is replaced the original TRANSFORM statement, with your
suggested one. I've even tried prefixing the [Sum Of ProjectDuration]
entries with qryWorkloadSum., however it still does not work.

Any ideas?

Thanks & regards

Duncan

--
Newsgroups are like one big sandbox that all of us
UseNet kiddies play in with peace & harmony.

Spammers, Cross-Posters, and Lamers are the
people that pee in our big sandbox.

Try this:
TRANSFORM Sum([Sum Of ProjectDuartion])\24 & Format(Sum([Sum Of
ProjectDuartion]) \ 1440 MOD 60, ":00") AS
[SumOfSum Of ProjectDuartion]
--
Duane Hookom
MS Access MVP


message -----Original Message-----
On Sun, 8 Feb 2004 23:07:06 -0000, "Duncan Edment"

Thanks for the reply. I have one question--and maybe
I'm being a bit thick
here--but where do I enter the expression you listed
above?

As a calculated field in the Query. You haven't posted
the SQL of the
crosstab query nor am I sure where you want this value to
appear in
the result so I can't be much more specific than that!



.


John,

I should have realised it would have made sense to post
the SQL of the Crosstab & Query.

The Crosstab SQL is:

PARAMETERS [Start Date] DateTime, [End Date] DateTime;
TRANSFORM Sum(qryWorkloadSum.[Sum Of ProjectDuartion]) AS
[SumOfSum Of ProjectDuartion]
SELECT qryWorkloadSum.fldProjectDescription, Sum
(qryWorkloadSum.[Sum Of ProjectDuartion]) AS [Total Of Sum
Of ProjectDuartion]
FROM qryWorkloadSum
WHERE (((qryWorkloadSum.fldDateWorked) Between [Start
Date] And [End Date]))
GROUP BY qryWorkloadSum.fldProjectDescription
PIVOT qryWorkloadSum.fldEmployeeName;

Whilst the SQL of the Query on which the Crosstab is based
is:

SELECT DISTINCTROW qryWorkload.fldProjectDescription,
qryWorkload.fldEmployeeName, qryWorkload.fldDateWorked, Sum
(qryWorkload.ProjectDuartion) AS [Sum Of ProjectDuartion]
FROM qryWorkload
GROUP BY qryWorkload.fldProjectDescription,
qryWorkload.fldEmployeeName, qryWorkload.fldDateWorked;


The SQL for the Query qryWorkload is:

SELECT tblProjects.fldProjectDescription,
tblEmployee.fldEmployeeName, tblTimeSheet.fldDateWorked,
Sum([fldEndTime]-[fldStartTime]) AS ProjectDuartion,
tblTimeSheet.fldStartTime, tblTimeSheet.fldEndTime,
tblTimeSheet.fldEmployeeID, tblTimeSheet.fldProjectID
FROM tblProjects INNER JOIN (tblEmployee INNER JOIN
tblTimeSheet ON tblEmployee.fldEmployeeID =
tblTimeSheet.fldEmployeeID) ON tblProjects.fldProjectID =
tblTimeSheet.fldProjectID
GROUP BY tblProjects.fldProjectDescription,
tblEmployee.fldEmployeeName, tblTimeSheet.fldDateWorked,
tblTimeSheet.fldStartTime, tblTimeSheet.fldEndTime,
tblTimeSheet.fldEmployeeID, tblTimeSheet.fldProjectID;


What I want to do is, in the Crosstab view, display the
times in the format HH:NN, rather than the decimal format
they are currently in. You suggested using the expression:

[field] \ 24 & Format([field] \ 1440 MOD 60, ":00")

However, I am unclear as to whether this should be placed
in the Crosstab query, or the query that the Crosstab is
based upon.

Also, are you suggesting that the calculated field above
replace the value field that is in the Crosstab?

Regards

Duncan
 
D

Duncan Edment

Duane,

My many thanks for your continued help with this.

BTW, I noticed a spelling mistake in my original query,
which I have now corrected. The [Sum Of Durations]column
does indeed display the correct total--i.e. the sum of all
displayed duration decimals. However, when I apply the
format command that both you and John provided, all I get
is the value "0:00". It makes no difference into what
column the format is placed, all I get is "0:00".

My SQL is listed below:

TRANSFORM Sum([Sum Of calcProjectDuration])\24 & Format(Sum
([Sum Of calcProjectDuration])\1440 Mod 60,":00") AS
[SumOfSum Of calcProjectDuration]
SELECT [qryWorkloadSum].[fldProjectDescription] AS
Project, Sum([qryWorkloadSum].[Sum Of calcProjectDuration])
\24 & Format(Sum([qryWorkloadSum].[Sum Of
calcProjectDuration])\1440 Mod 60,":00") AS [Sum of
Durations]
FROM qryWorkloadSum
GROUP BY [qryWorkloadSum].[fldProjectDescription]
PIVOT [qryWorkloadSum].[fldEmployeeName];


Once again, my many thanks for your help and continued
support with this problem.

Thanks & regards

Duncan
-----Original Message-----
Are you getting any total in the [Sum Of Duartions] column?

--
Duane Hookom
MS Access MVP


"Duncan Edment"
message news:%[email protected]...
Duane,

Modified SQL below:

PARAMETERS [Start Date?] DateTime, [End Date?] DateTime;
TRANSFORM Sum(qryWorkloadSum.[Sum Of ProjectDuartion]) \24 &
Format(Sum(qryWorkloadSum.[Sum Of ProjectDuartion]) \1440 Mod 60,":00") AS
Duration
SELECT qryWorkloadSum.fldProjectDescription AS Project,
Sum(qryWorkloadSum.[Sum Of ProjectDuartion]) AS [Sum Of Duartions]
FROM qryWorkloadSum
WHERE (((qryWorkloadSum.fldDateWorked) Between [Start Date?] And [End
Date?]))
GROUP BY qryWorkloadSum.fldProjectDescription
PIVOT qryWorkloadSum.fldEmployeeName;


--
Newsgroups are like one big sandbox that all of us
UseNet kiddies play in with peace & harmony.

Spammers, Cross-Posters, and Lamers are the
people that pee in our big sandbox.

Paste your modified SQL into a reply.

--
Duane Hookom
Microsoft Access MVP


"Duncan Edment"
message Duane,

Thanks for the reply.

I've tried your suggestion however, the Crosstab now displays all time
entries under each employee as "0:00"!

All I've done is replaced the original TRANSFORM statement, with your
suggested one. I've even tried prefixing the [Sum Of ProjectDuration]
entries with qryWorkloadSum., however it still does not work.

Any ideas?

Thanks & regards

Duncan

--
Newsgroups are like one big sandbox that all of us
UseNet kiddies play in with peace & harmony.

Spammers, Cross-Posters, and Lamers are the
people that pee in our big sandbox.

Try this:
TRANSFORM Sum([Sum Of ProjectDuartion])\24 & Format(Sum([Sum Of
ProjectDuartion]) \ 1440 MOD 60, ":00") AS
[SumOfSum Of ProjectDuartion]
--
Duane Hookom
MS Access MVP


"Duncan Edment"
in
message [email protected]...
-----Original Message-----
On Sun, 8 Feb 2004 23:07:06 -0000, "Duncan Edment"

Thanks for the reply. I have one question-- and maybe
I'm being a bit thick
here--but where do I enter the expression you listed
above?

As a calculated field in the Query. You haven't posted
the SQL of the
crosstab query nor am I sure where you want this value to
appear in
the result so I can't be much more specific than that!


John W. Vinson[MVP]
Come for live chats every Tuesday and Thursday
http://go.compuserve.com/msdevapps? loc=us&access=public
.


John,

I should have realised it would have made sense to post
the SQL of the Crosstab & Query.

The Crosstab SQL is:

PARAMETERS [Start Date] DateTime, [End Date] DateTime;
TRANSFORM Sum(qryWorkloadSum.[Sum Of ProjectDuartion]) AS
[SumOfSum Of ProjectDuartion]
SELECT qryWorkloadSum.fldProjectDescription, Sum
(qryWorkloadSum.[Sum Of ProjectDuartion]) AS [Total Of Sum
Of ProjectDuartion]
FROM qryWorkloadSum
WHERE (((qryWorkloadSum.fldDateWorked) Between [Start
Date] And [End Date]))
GROUP BY qryWorkloadSum.fldProjectDescription
PIVOT qryWorkloadSum.fldEmployeeName;

Whilst the SQL of the Query on which the Crosstab is based
is:

SELECT DISTINCTROW qryWorkload.fldProjectDescription,
qryWorkload.fldEmployeeName, qryWorkload.fldDateWorked, Sum
(qryWorkload.ProjectDuartion) AS [Sum Of ProjectDuartion]
FROM qryWorkload
GROUP BY qryWorkload.fldProjectDescription,
qryWorkload.fldEmployeeName, qryWorkload.fldDateWorked;


The SQL for the Query qryWorkload is:

SELECT tblProjects.fldProjectDescription,
tblEmployee.fldEmployeeName, tblTimeSheet.fldDateWorked,
Sum([fldEndTime]-[fldStartTime]) AS ProjectDuartion,
tblTimeSheet.fldStartTime, tblTimeSheet.fldEndTime,
tblTimeSheet.fldEmployeeID, tblTimeSheet.fldProjectID
FROM tblProjects INNER JOIN (tblEmployee INNER JOIN
tblTimeSheet ON tblEmployee.fldEmployeeID =
tblTimeSheet.fldEmployeeID) ON tblProjects.fldProjectID =
tblTimeSheet.fldProjectID
GROUP BY tblProjects.fldProjectDescription,
tblEmployee.fldEmployeeName, tblTimeSheet.fldDateWorked,
tblTimeSheet.fldStartTime, tblTimeSheet.fldEndTime,
tblTimeSheet.fldEmployeeID, tblTimeSheet.fldProjectID;


What I want to do is, in the Crosstab view, display the
times in the format HH:NN, rather than the decimal format
they are currently in. You suggested using the expression:

[field] \ 24 & Format([field] \ 1440 MOD 60, ":00")

However, I am unclear as to whether this should be placed
in the Crosstab query, or the query that the Crosstab is
based upon.

Also, are you suggesting that the calculated field above
replace the value field that is in the Crosstab?

Regards

Duncan


.
 
D

Duane Hookom

Sorry, I hadn't checked JV's expression. If you are storing you time
durations in a Date/Time field, try:
Sum([Sum Of calcProjectDuration])*24\1 & Right(Format(Sum([Sum Of
calcProjectDuration]),"Short Time"),3)

--
Duane Hookom
Microsoft Access MVP


Duncan Edment said:
Duane,

My many thanks for your continued help with this.

BTW, I noticed a spelling mistake in my original query,
which I have now corrected. The [Sum Of Durations]column
does indeed display the correct total--i.e. the sum of all
displayed duration decimals. However, when I apply the
format command that both you and John provided, all I get
is the value "0:00". It makes no difference into what
column the format is placed, all I get is "0:00".

My SQL is listed below:

TRANSFORM Sum([Sum Of calcProjectDuration])\24 & Format(Sum
([Sum Of calcProjectDuration])\1440 Mod 60,":00") AS
[SumOfSum Of calcProjectDuration]
SELECT [qryWorkloadSum].[fldProjectDescription] AS
Project, Sum([qryWorkloadSum].[Sum Of calcProjectDuration])
\24 & Format(Sum([qryWorkloadSum].[Sum Of
calcProjectDuration])\1440 Mod 60,":00") AS [Sum of
Durations]
FROM qryWorkloadSum
GROUP BY [qryWorkloadSum].[fldProjectDescription]
PIVOT [qryWorkloadSum].[fldEmployeeName];


Once again, my many thanks for your help and continued
support with this problem.

Thanks & regards

Duncan
-----Original Message-----
Are you getting any total in the [Sum Of Duartions] column?

--
Duane Hookom
MS Access MVP


"Duncan Edment"
message news:%[email protected]...
Duane,

Modified SQL below:

PARAMETERS [Start Date?] DateTime, [End Date?] DateTime;
TRANSFORM Sum(qryWorkloadSum.[Sum Of ProjectDuartion]) \24 &
Format(Sum(qryWorkloadSum.[Sum Of ProjectDuartion]) \1440 Mod 60,":00") AS
Duration
SELECT qryWorkloadSum.fldProjectDescription AS Project,
Sum(qryWorkloadSum.[Sum Of ProjectDuartion]) AS [Sum Of Duartions]
FROM qryWorkloadSum
WHERE (((qryWorkloadSum.fldDateWorked) Between [Start Date?] And [End
Date?]))
GROUP BY qryWorkloadSum.fldProjectDescription
PIVOT qryWorkloadSum.fldEmployeeName;


--
Newsgroups are like one big sandbox that all of us
UseNet kiddies play in with peace & harmony.

Spammers, Cross-Posters, and Lamers are the
people that pee in our big sandbox.

Paste your modified SQL into a reply.

--
Duane Hookom
Microsoft Access MVP


"Duncan Edment"
message Duane,

Thanks for the reply.

I've tried your suggestion however, the Crosstab now displays all time
entries under each employee as "0:00"!

All I've done is replaced the original TRANSFORM statement, with your
suggested one. I've even tried prefixing the [Sum Of ProjectDuration]
entries with qryWorkloadSum., however it still does not work.

Any ideas?

Thanks & regards

Duncan

--
Newsgroups are like one big sandbox that all of us
UseNet kiddies play in with peace & harmony.

Spammers, Cross-Posters, and Lamers are the
people that pee in our big sandbox.

Try this:
TRANSFORM Sum([Sum Of ProjectDuartion])\24 & Format(Sum([Sum Of
ProjectDuartion]) \ 1440 MOD 60, ":00") AS
[SumOfSum Of ProjectDuartion]
--
Duane Hookom
MS Access MVP


"Duncan Edment"
in
message [email protected]...
-----Original Message-----
On Sun, 8 Feb 2004 23:07:06 -0000, "Duncan Edment"

Thanks for the reply. I have one question-- and maybe
I'm being a bit thick
here--but where do I enter the expression you listed
above?

As a calculated field in the Query. You haven't posted
the SQL of the
crosstab query nor am I sure where you want this value to
appear in
the result so I can't be much more specific than that!


John W. Vinson[MVP]
Come for live chats every Tuesday and Thursday
http://go.compuserve.com/msdevapps? loc=us&access=public
.


John,

I should have realised it would have made sense to post
the SQL of the Crosstab & Query.

The Crosstab SQL is:

PARAMETERS [Start Date] DateTime, [End Date] DateTime;
TRANSFORM Sum(qryWorkloadSum.[Sum Of ProjectDuartion]) AS
[SumOfSum Of ProjectDuartion]
SELECT qryWorkloadSum.fldProjectDescription, Sum
(qryWorkloadSum.[Sum Of ProjectDuartion]) AS [Total Of Sum
Of ProjectDuartion]
FROM qryWorkloadSum
WHERE (((qryWorkloadSum.fldDateWorked) Between [Start
Date] And [End Date]))
GROUP BY qryWorkloadSum.fldProjectDescription
PIVOT qryWorkloadSum.fldEmployeeName;

Whilst the SQL of the Query on which the Crosstab is based
is:

SELECT DISTINCTROW qryWorkload.fldProjectDescription,
qryWorkload.fldEmployeeName, qryWorkload.fldDateWorked, Sum
(qryWorkload.ProjectDuartion) AS [Sum Of ProjectDuartion]
FROM qryWorkload
GROUP BY qryWorkload.fldProjectDescription,
qryWorkload.fldEmployeeName, qryWorkload.fldDateWorked;


The SQL for the Query qryWorkload is:

SELECT tblProjects.fldProjectDescription,
tblEmployee.fldEmployeeName, tblTimeSheet.fldDateWorked,
Sum([fldEndTime]-[fldStartTime]) AS ProjectDuartion,
tblTimeSheet.fldStartTime, tblTimeSheet.fldEndTime,
tblTimeSheet.fldEmployeeID, tblTimeSheet.fldProjectID
FROM tblProjects INNER JOIN (tblEmployee INNER JOIN
tblTimeSheet ON tblEmployee.fldEmployeeID =
tblTimeSheet.fldEmployeeID) ON tblProjects.fldProjectID =
tblTimeSheet.fldProjectID
GROUP BY tblProjects.fldProjectDescription,
tblEmployee.fldEmployeeName, tblTimeSheet.fldDateWorked,
tblTimeSheet.fldStartTime, tblTimeSheet.fldEndTime,
tblTimeSheet.fldEmployeeID, tblTimeSheet.fldProjectID;


What I want to do is, in the Crosstab view, display the
times in the format HH:NN, rather than the decimal format
they are currently in. You suggested using the expression:

[field] \ 24 & Format([field] \ 1440 MOD 60, ":00")

However, I am unclear as to whether this should be placed
in the Crosstab query, or the query that the Crosstab is
based upon.

Also, are you suggesting that the calculated field above
replace the value field that is in the Crosstab?

Regards

Duncan


.
 
D

Duncan Edment

Duane,

In some cases, it seems to be adding an hour onto the total number of hours,
but only in certain cases.

Where the portion to the right of the decimal is 5 or more, it seems to be
rounding up the digit to the left of the decimal, in the calculation:

Sum([Sum Of calcProjectDuration])*24\1

To get round this, I had to alter the calculation to:

Int(Sum([Sum Of calcProjectDuration])*24) & Right(Format(Sum([Sum Of
calcProjectDuration]),"Short Time"),3)

This would appear to now work, although I would appreciate your comments on
the correctness of doing it this way.

Thanks & regards

Duncan

--
Newsgroups are like one big sandbox that all of us
UseNet kiddies play in with peace & harmony.

Spammers, Cross-Posters, and Lamers are the
people that pee in our big sandbox.

Duane Hookom said:
Sorry, I hadn't checked JV's expression. If you are storing you time
durations in a Date/Time field, try:
Sum([Sum Of calcProjectDuration])*24\1 & Right(Format(Sum([Sum Of
calcProjectDuration]),"Short Time"),3)

--
Duane Hookom
Microsoft Access MVP


Duncan Edment said:
Duane,

My many thanks for your continued help with this.

BTW, I noticed a spelling mistake in my original query,
which I have now corrected. The [Sum Of Durations]column
does indeed display the correct total--i.e. the sum of all
displayed duration decimals. However, when I apply the
format command that both you and John provided, all I get
is the value "0:00". It makes no difference into what
column the format is placed, all I get is "0:00".

My SQL is listed below:

TRANSFORM Sum([Sum Of calcProjectDuration])\24 & Format(Sum
([Sum Of calcProjectDuration])\1440 Mod 60,":00") AS
[SumOfSum Of calcProjectDuration]
SELECT [qryWorkloadSum].[fldProjectDescription] AS
Project, Sum([qryWorkloadSum].[Sum Of calcProjectDuration])
\24 & Format(Sum([qryWorkloadSum].[Sum Of
calcProjectDuration])\1440 Mod 60,":00") AS [Sum of
Durations]
FROM qryWorkloadSum
GROUP BY [qryWorkloadSum].[fldProjectDescription]
PIVOT [qryWorkloadSum].[fldEmployeeName];


Once again, my many thanks for your help and continued
support with this problem.

Thanks & regards

Duncan
-----Original Message-----
Are you getting any total in the [Sum Of Duartions] column?

--
Duane Hookom
MS Access MVP


"Duncan Edment"
message Duane,

Modified SQL below:

PARAMETERS [Start Date?] DateTime, [End Date?] DateTime;
TRANSFORM Sum(qryWorkloadSum.[Sum Of ProjectDuartion]) \24 &
Format(Sum(qryWorkloadSum.[Sum Of ProjectDuartion]) \1440 Mod 60,":00") AS
Duration
SELECT qryWorkloadSum.fldProjectDescription AS Project,
Sum(qryWorkloadSum.[Sum Of ProjectDuartion]) AS [Sum Of Duartions]
FROM qryWorkloadSum
WHERE (((qryWorkloadSum.fldDateWorked) Between [Start Date?] And [End
Date?]))
GROUP BY qryWorkloadSum.fldProjectDescription
PIVOT qryWorkloadSum.fldEmployeeName;


--
Newsgroups are like one big sandbox that all of us
UseNet kiddies play in with peace & harmony.

Spammers, Cross-Posters, and Lamers are the
people that pee in our big sandbox.

Paste your modified SQL into a reply.

--
Duane Hookom
Microsoft Access MVP


"Duncan Edment"
message Duane,

Thanks for the reply.

I've tried your suggestion however, the Crosstab now displays all time
entries under each employee as "0:00"!

All I've done is replaced the original TRANSFORM statement, with your
suggested one. I've even tried prefixing the [Sum Of ProjectDuration]
entries with qryWorkloadSum., however it still does not work.

Any ideas?

Thanks & regards

Duncan

--
Newsgroups are like one big sandbox that all of us
UseNet kiddies play in with peace & harmony.

Spammers, Cross-Posters, and Lamers are the
people that pee in our big sandbox.

Try this:
TRANSFORM Sum([Sum Of ProjectDuartion])\24 & Format(Sum([Sum Of
ProjectDuartion]) \ 1440 MOD 60, ":00") AS
[SumOfSum Of ProjectDuartion]
--
Duane Hookom
MS Access MVP


"Duncan Edment"
in
message [email protected]...
-----Original Message-----
<duncan@_NOSPAMPLEASE_edment.freeserve.co.uk>
wrote:

Thanks for the reply. I have one question-- and maybe
I'm being a bit thick
here--but where do I enter the expression you listed
above?

As a calculated field in the Query. You haven't posted
the SQL of the
crosstab query nor am I sure where you want this value to
appear in
the result so I can't be much more specific than that!


John W. Vinson[MVP]
Come for live chats every Tuesday and Thursday
loc=us&access=public
.


John,

I should have realised it would have made sense to post
the SQL of the Crosstab & Query.

The Crosstab SQL is:

PARAMETERS [Start Date] DateTime, [End Date] DateTime;
TRANSFORM Sum(qryWorkloadSum.[Sum Of ProjectDuartion]) AS
[SumOfSum Of ProjectDuartion]
SELECT qryWorkloadSum.fldProjectDescription, Sum
(qryWorkloadSum.[Sum Of ProjectDuartion]) AS [Total Of Sum
Of ProjectDuartion]
FROM qryWorkloadSum
WHERE (((qryWorkloadSum.fldDateWorked) Between [Start
Date] And [End Date]))
GROUP BY qryWorkloadSum.fldProjectDescription
PIVOT qryWorkloadSum.fldEmployeeName;

Whilst the SQL of the Query on which the Crosstab is based
is:

SELECT DISTINCTROW qryWorkload.fldProjectDescription,
qryWorkload.fldEmployeeName, qryWorkload.fldDateWorked, Sum
(qryWorkload.ProjectDuartion) AS [Sum Of ProjectDuartion]
FROM qryWorkload
GROUP BY qryWorkload.fldProjectDescription,
qryWorkload.fldEmployeeName, qryWorkload.fldDateWorked;


The SQL for the Query qryWorkload is:

SELECT tblProjects.fldProjectDescription,
tblEmployee.fldEmployeeName, tblTimeSheet.fldDateWorked,
Sum([fldEndTime]-[fldStartTime]) AS ProjectDuartion,
tblTimeSheet.fldStartTime, tblTimeSheet.fldEndTime,
tblTimeSheet.fldEmployeeID,
tblTimeSheet.fldProjectID
FROM tblProjects INNER JOIN (tblEmployee INNER JOIN
tblTimeSheet ON tblEmployee.fldEmployeeID =
tblTimeSheet.fldEmployeeID) ON tblProjects.fldProjectID =
tblTimeSheet.fldProjectID
GROUP BY tblProjects.fldProjectDescription,
tblEmployee.fldEmployeeName, tblTimeSheet.fldDateWorked,
tblTimeSheet.fldStartTime, tblTimeSheet.fldEndTime,
tblTimeSheet.fldEmployeeID,
tblTimeSheet.fldProjectID;


What I want to do is, in the Crosstab view, display the
times in the format HH:NN, rather than the decimal format
they are currently in. You suggested using the expression:

[field] \ 24 & Format([field] \ 1440 MOD 60, ":00")

However, I am unclear as to whether this should be placed
in the Crosstab query, or the query that the Crosstab is
based upon.

Also, are you suggesting that the calculated field above
replace the value field that is in the Crosstab?

Regards

Duncan











.
 
D

Duane Hookom

If it works, then use it. Are you sure you used \ rather than /?

--
Duane Hookom
MS Access MVP


Duncan Edment said:
Duane,

In some cases, it seems to be adding an hour onto the total number of hours,
but only in certain cases.

Where the portion to the right of the decimal is 5 or more, it seems to be
rounding up the digit to the left of the decimal, in the calculation:

Sum([Sum Of calcProjectDuration])*24\1

To get round this, I had to alter the calculation to:

Int(Sum([Sum Of calcProjectDuration])*24) & Right(Format(Sum([Sum Of
calcProjectDuration]),"Short Time"),3)

This would appear to now work, although I would appreciate your comments on
the correctness of doing it this way.

Thanks & regards

Duncan

--
Newsgroups are like one big sandbox that all of us
UseNet kiddies play in with peace & harmony.

Spammers, Cross-Posters, and Lamers are the
people that pee in our big sandbox.

Duane Hookom said:
Sorry, I hadn't checked JV's expression. If you are storing you time
durations in a Date/Time field, try:
Sum([Sum Of calcProjectDuration])*24\1 & Right(Format(Sum([Sum Of
calcProjectDuration]),"Short Time"),3)

--
Duane Hookom
Microsoft Access MVP


Duncan Edment said:
Duane,

My many thanks for your continued help with this.

BTW, I noticed a spelling mistake in my original query,
which I have now corrected. The [Sum Of Durations]column
does indeed display the correct total--i.e. the sum of all
displayed duration decimals. However, when I apply the
format command that both you and John provided, all I get
is the value "0:00". It makes no difference into what
column the format is placed, all I get is "0:00".

My SQL is listed below:

TRANSFORM Sum([Sum Of calcProjectDuration])\24 & Format(Sum
([Sum Of calcProjectDuration])\1440 Mod 60,":00") AS
[SumOfSum Of calcProjectDuration]
SELECT [qryWorkloadSum].[fldProjectDescription] AS
Project, Sum([qryWorkloadSum].[Sum Of calcProjectDuration])
\24 & Format(Sum([qryWorkloadSum].[Sum Of
calcProjectDuration])\1440 Mod 60,":00") AS [Sum of
Durations]
FROM qryWorkloadSum
GROUP BY [qryWorkloadSum].[fldProjectDescription]
PIVOT [qryWorkloadSum].[fldEmployeeName];


Once again, my many thanks for your help and continued
support with this problem.

Thanks & regards

Duncan

-----Original Message-----
Are you getting any total in the [Sum Of Duartions]
column?

--
Duane Hookom
MS Access MVP


"Duncan Edment"
message Duane,

Modified SQL below:

PARAMETERS [Start Date?] DateTime, [End Date?] DateTime;
TRANSFORM Sum(qryWorkloadSum.[Sum Of ProjectDuartion])
\24 &
Format(Sum(qryWorkloadSum.[Sum Of ProjectDuartion])
\1440 Mod 60,":00") AS
Duration
SELECT qryWorkloadSum.fldProjectDescription AS Project,
Sum(qryWorkloadSum.[Sum Of ProjectDuartion]) AS [Sum Of
Duartions]
FROM qryWorkloadSum
WHERE (((qryWorkloadSum.fldDateWorked) Between [Start
Date?] And [End
Date?]))
GROUP BY qryWorkloadSum.fldProjectDescription
PIVOT qryWorkloadSum.fldEmployeeName;


--
Newsgroups are like one big sandbox that all of us
UseNet kiddies play in with peace & harmony.

Spammers, Cross-Posters, and Lamers are the
people that pee in our big sandbox.

in message
Paste your modified SQL into a reply.

--
Duane Hookom
Microsoft Access MVP


"Duncan Edment"
message Duane,

Thanks for the reply.

I've tried your suggestion however, the Crosstab
now displays all time
entries under each employee as "0:00"!

All I've done is replaced the original TRANSFORM
statement, with your
suggested one. I've even tried prefixing the [Sum
Of ProjectDuration]
entries with qryWorkloadSum., however it still does
not work.

Any ideas?

Thanks & regards

Duncan

--
Newsgroups are like one big sandbox that all of us
UseNet kiddies play in with peace & harmony.

Spammers, Cross-Posters, and Lamers are the
people that pee in our big sandbox.

"Duane Hookom" <duanehookom@NO_SPAMhotmail.com>
wrote in message
Try this:
TRANSFORM Sum([Sum Of ProjectDuartion])\24 &
Format(Sum([Sum Of
ProjectDuartion]) \ 1440 MOD 60, ":00") AS
[SumOfSum Of ProjectDuartion]
--
Duane Hookom
MS Access MVP


"Duncan Edment"
in
message [email protected]...
-----Original Message-----
On Sun, 8 Feb 2004 23:07:06 -0000, "Duncan
Edment"
<duncan@_NOSPAMPLEASE_edment.freeserve.co.uk>
wrote:

Thanks for the reply. I have one question--
and maybe
I'm being a bit thick
here--but where do I enter the expression you
listed
above?

As a calculated field in the Query. You
haven't posted
the SQL of the
crosstab query nor am I sure where you want
this value to
appear in
the result so I can't be much more specific
than that!


John W. Vinson[MVP]
Come for live chats every Tuesday and
Thursday
http://go.compuserve.com/msdevapps?
loc=us&access=public
.


John,

I should have realised it would have made sense
to post
the SQL of the Crosstab & Query.

The Crosstab SQL is:

PARAMETERS [Start Date] DateTime, [End Date]
DateTime;
TRANSFORM Sum(qryWorkloadSum.[Sum Of
ProjectDuartion]) AS
[SumOfSum Of ProjectDuartion]
SELECT qryWorkloadSum.fldProjectDescription, Sum
(qryWorkloadSum.[Sum Of ProjectDuartion]) AS
[Total Of Sum
Of ProjectDuartion]
FROM qryWorkloadSum
WHERE (((qryWorkloadSum.fldDateWorked) Between
[Start
Date] And [End Date]))
GROUP BY qryWorkloadSum.fldProjectDescription
PIVOT qryWorkloadSum.fldEmployeeName;

Whilst the SQL of the Query on which the
Crosstab is based
is:

SELECT DISTINCTROW
qryWorkload.fldProjectDescription,
qryWorkload.fldEmployeeName,
qryWorkload.fldDateWorked, Sum
(qryWorkload.ProjectDuartion) AS [Sum Of
ProjectDuartion]
FROM qryWorkload
GROUP BY qryWorkload.fldProjectDescription,
qryWorkload.fldEmployeeName,
qryWorkload.fldDateWorked;


The SQL for the Query qryWorkload is:

SELECT tblProjects.fldProjectDescription,
tblEmployee.fldEmployeeName,
tblTimeSheet.fldDateWorked,
Sum([fldEndTime]-[fldStartTime]) AS
ProjectDuartion,
tblTimeSheet.fldStartTime,
tblTimeSheet.fldEndTime,
tblTimeSheet.fldEmployeeID,
tblTimeSheet.fldProjectID
FROM tblProjects INNER JOIN (tblEmployee INNER
JOIN
tblTimeSheet ON tblEmployee.fldEmployeeID =
tblTimeSheet.fldEmployeeID) ON
tblProjects.fldProjectID =
tblTimeSheet.fldProjectID
GROUP BY tblProjects.fldProjectDescription,
tblEmployee.fldEmployeeName,
tblTimeSheet.fldDateWorked,
tblTimeSheet.fldStartTime,
tblTimeSheet.fldEndTime,
tblTimeSheet.fldEmployeeID,
tblTimeSheet.fldProjectID;


What I want to do is, in the Crosstab view,
display the
times in the format HH:NN, rather than the
decimal format
they are currently in. You suggested using the
expression:

[field] \ 24 & Format([field] \ 1440 MOD
60, ":00")

However, I am unclear as to whether this should
be placed
in the Crosstab query, or the query that the
Crosstab is
based upon.

Also, are you suggesting that the calculated
field above
replace the value field that is in the Crosstab?

Regards

Duncan











.
 
D

Duncan Edment

Duane,

Yep, I made sure that it was a '\' that was, and not a '/'.

As an example. I have a duration that is showing as the
decimal value 0.1875. When manually converted to HH:NN,
this should equal 4:30. However, using the expression you
suggested, I get the result 5:30.

However, using the INT function, I get the correct value--
4:30.

May I just take this opportunity to thank both you and
John for your help & support with this.

Warmest regards

Duncan

-----Original Message-----
If it works, then use it. Are you sure you used \ rather than /?

--
Duane Hookom
MS Access MVP


"Duncan Edment"
message news:[email protected]...
Duane,

In some cases, it seems to be adding an hour onto the
total number of
hours,
but only in certain cases.

Where the portion to the right of the decimal is 5 or more, it seems to be
rounding up the digit to the left of the decimal, in the calculation:

Sum([Sum Of calcProjectDuration])*24\1

To get round this, I had to alter the calculation to:

Int(Sum([Sum Of calcProjectDuration])*24) & Right(Format (Sum([Sum Of
calcProjectDuration]),"Short Time"),3)

This would appear to now work, although I would
appreciate your comments
on
the correctness of doing it this way.

Thanks & regards

Duncan

--
Newsgroups are like one big sandbox that all of us
UseNet kiddies play in with peace & harmony.

Spammers, Cross-Posters, and Lamers are the
people that pee in our big sandbox.

Sorry, I hadn't checked JV's expression. If you are storing you time
durations in a Date/Time field, try:
Sum([Sum Of calcProjectDuration])*24\1 & Right(Format (Sum([Sum Of
calcProjectDuration]),"Short Time"),3)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top