Need Help with specific query described below

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a Table with 3 fields ( Contract Number, Ind. and SystemDate ).
ex.
Contract Ind SystemDate
111 A 200401010830
111 B 200401010835
111 A 200401010840
What query will return the following result (list all the SystemDates where
Ind=A in one column and all the SystemDates where Ind=B in the second
column-all in ascending order):
Contract Ind=A Ind=B
111 200401010830 200401010835
111 200401010840 -

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

Try:

SELECT Contract,
IIf(Ind = A, SystemDate) As Ind_A,
IIf(Ind = B, SystemDate) As Ind_B
FROM table_name
WHERE < criteria >
GROUP BY Contract, IIf(Ind = A, SystemDate), IIf(Ind = B, SystemDate)

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

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

iQA/AwUBQgBirIechKqOuFEgEQL2tACgyiojDurntgsuFelfAnJJ14svhZoAnRzW
4AUMBnsOhQdVNaNcklpCZVxn
=5kTr
-----END PGP SIGNATURE-----
 
Thank you so much for the reply. My problem is that I need the two columns
(indA and indB) to allign exactly as described below, b/c I need to subtract
column IndA from column IndB.
Contract Ind=A Ind=B Difference(min)Also, Table1 is extremely large and apart from IndA and B it contains
hundreds of other indicators.
Any suggestion would be greatly appreciated.
Thank you again
Irina
 
Back
Top