I have tried and failed <grin>, any help would be appreciated.
Here is my data:
ID, dtDate, Hours, PayType
==============
Joe, 3/23/06, 7, Regular
Joe, 3/23/06, 1, Regular
Joe, 3/23/06, 2, Overtime
Joe, 3/24/06, 4, Regular
What SQL to get this recordset?
ID, dtDate, Regular, Overtime
======================
Joe, 3/23/06, 8, 2
Joe, 3/24/06, 4, 0 2 1035
See if this will help.
TRANSFORM Sum(TableName.Hours) AS SumOfHours
SELECT TableName.ID, TableName.dtDate
FROM TableName
GROUP BY TableName.ID, TableName.dtDate
ORDER BY TableName.PayType DESC
PIVOT TableName.PayType;
--
Wayne Morgan
MS Access MVP
"SaltyBoat" <ha*****@gmail.com> wrote in message
news:11**********************@v46g2000cwv.googlegr oups.com... I have tried and failed <grin>, any help would be appreciated.
Here is my data:
ID, dtDate, Hours, PayType ============== Joe, 3/23/06, 7, Regular Joe, 3/23/06, 1, Regular Joe, 3/23/06, 2, Overtime Joe, 3/24/06, 4, Regular
What SQL to get this recordset?
ID, dtDate, Regular, Overtime ====================== Joe, 3/23/06, 8, 2 Joe, 3/24/06, 4, 0
A crosstab query, of course! Thanks for the reminder! This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: BVM |
last post by:
Hi, All:
I have this error. It seems execution time is too long. Actually the execution time is about 30 seconds(I tested in Query analyzer). How do I solve this problem?
...
|
by: BVM |
last post by:
Hi, All:
I have this error. It seems execution time is too long. Actually the execution time is about 30 seconds(I tested in Query analyzer). How do I solve this problem?
...
|
by: John Salerno |
last post by:
Ok, here's a problem I've sort of assigned to myself for fun, but it's
turning out to be quite a pain to wrap my mind around. It's from a
puzzle game. It will help if you look at this image:
...
|
by: vj |
last post by:
Hi all,
I want to solve the two equations
u*tan(u)=w
and
u^2 + w^2=V^2, where V is a known constant, and u and w are the two
unknowns to be determined. Please can someone suggest me how to...
|
by: arun |
last post by:
Query is too complex
--------------------------------------------------------------------------------
Hi, I was trying to solve this problem since last two days but couldn't
find any solution.
...
| |
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |