473,378 Members | 1,462 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Translate CrossTab Querys (Please Help!!)

I have this query in access and I need to translate to SQL ansi

TRANSFORM Sum(BilletSCHQTY) AS SumOfBilletSCHQTY
SELECT Tap,
Mandrin,
BilletOD,
BilletLength,
FROM Tbl_ExtruOptimize_Src
GROUP BY Tbl_ExtruOptimize_Src.Tap,
Tbl_ExtruOptimize_Src.Mandrin,
Tbl_ExtruOptimize_Src.BilletOD,
Tbl_ExtruOptimize_Src.BilletLength,
ORDER BY Tbl_ExtruOptimize_Src.Tap,
Tbl_ExtruOptimize_Src.Mandrin,
Tbl_ExtruOptimize_Src.BilletOD,
Tbl_ExtruOptimize_Src.BilletLength,
PIVOT [Org_StartDate];

The result show Tap, Mandrin, BilletOD and BilletLength grouped by
Sum(BilletSCHQTY) for the differents dates. I need to change this query
for an ansi query.

Thank you.

Feb 24 '06 #1
1 1206
rguarnieri wrote:
I have this query in access and I need to translate to SQL ansi

TRANSFORM Sum(BilletSCHQTY) AS SumOfBilletSCHQTY
SELECT Tap,
Mandrin,
BilletOD,
BilletLength,
FROM Tbl_ExtruOptimize_Src
GROUP BY Tbl_ExtruOptimize_Src.Tap,
Tbl_ExtruOptimize_Src.Mandrin,
Tbl_ExtruOptimize_Src.BilletOD,
Tbl_ExtruOptimize_Src.BilletLength,
ORDER BY Tbl_ExtruOptimize_Src.Tap,
Tbl_ExtruOptimize_Src.Mandrin,
Tbl_ExtruOptimize_Src.BilletOD,
Tbl_ExtruOptimize_Src.BilletLength,
PIVOT [Org_StartDate];

The result show Tap, Mandrin, BilletOD and BilletLength grouped by
Sum(BilletSCHQTY) for the differents dates. I need to change this query
for an ansi query.


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

If you mean not using JET ANSI 92 and the SQL u're using has the CASE
expression then you'd do something like this:

SELECT Tap,
Mandrin,
BilletOD,
BilletLength

SUM(CASE
WHEN Org_StartDate BETWEEN '2006-01-01' AND '2006-03-31'
THEN BilletSCHQTY
ELSE NULL
END) As Q1,

SUM(CASE
WHEN Org_StartDate BETWEEN '2006-04-01' AND '2006-06-30'
THEN BilletSCHQTY
ELSE NULL
END) As Q2,
... etc. for other quarters ...

FROM Tbl_ExtruOptimize_Src
GROUP BY Tap,
Mandrin,
BilletOD,
BilletLength
ORDER BY Tap,
Mandrin,
BilletOD,
BilletLength
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQ//JZYechKqOuFEgEQKrAgCfQolems/UUDbL8iAI4qOg0yonym8AoI3w
R75T+Cpy3oHTH1pCG9G7XG/6
=jupz
-----END PGP SIGNATURE-----
Feb 25 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: KK | last post by:
Hi Peoples, Can anyone give me any learning materials for learning C++. i.e. can you give me any docs or give me the link to any website that has info on programming in general or C++. (ok...
2
by: m3ckon | last post by:
Hi there, had to rush some sql and am now going back to it due to a slow db performance. I have a db for sales leads and have created 3 views based on the data I need to produce. However one...
1
by: HolaGoogle | last post by:
Hi all, Please help me with the following..it's realy urgent and i tried everything i could and i can't get it work properly!! Thanks in advance. Here's what i'm trying to accomplish: in my...
0
by: Kurt Watson | last post by:
I’m having a different kind of problem with Hotmail when I sign in it says, "Web Browser Software Limitations Your Current Software Will Limit Your Ability to Use Hotmail You are using a web...
7
by: Alan Bashy | last post by:
Please, guys, In need help with this. It is due in the next week. Please, help me to implement the functions in this programm especially the first three constructor. I need them guys. Please, help...
4
by: David | last post by:
Hi, I was hoping someone could confirm the following about the following number 2 SQL query: 1. This extracts the data required given that there is a recording to match the records 2. This...
6
by: jenipriya | last post by:
Hi all... its very urgent.. please........i m a beginner in oracle.... Anyone please help me wit dese codes i hv tried... and correct the errors... The table structures i hav Employee (EmpID,...
8
by: Syoam4ka | last post by:
Hi, I have a WinApp in which I have a pictureBox. I can draw in it like in the paint of windows - I accomplish that with an arrayList of Points and DrawLines method of the Graphics. So it...
0
by: Chriskim | last post by:
Hi, I am trying to translate a simple program that was written in matlab to python. I uses arrays to plot multiple data in single graph. I wrote the python according to the matlab language....
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.