[thelist] SQL Chaos!!

Martyn Haigh martyn.haigh at virgincosmetics.com
Tue Jan 28 10:08:01 CST 2003


Hello,

I - like most people - hate SQL, often because I spend hours trying to do
something unsuccessfully before pulling all my hair out!

This is what I'm trying to do.
I have a database with 4 fields lets call them ID, fieldA, fieldB and fieldC
and another database with an ID that is the same as the previous ID and
DateCreated (plus some other stuff that doesn't matter at the moment).

FieldA through C are all Bits.
ID is an int.
DateCreated is a DateTime.
I'm trying to create a stats package that will will count up the totals of
each FieldA through C for each day and then give a total of fields A through
C for days between two given date inputs.

Much like this
		01-01-03	02-02-03 	03-02-03	....etc
Field A	3		5	   	12		....etc
Field B	7		12       	0		....etc
Field C	12		24 	   	15		....etc
Total		22		41	   	27		....etc

To me this sounds like a nightmare.  I've been researching and I see the
need for counts, joins, group by's - but have no idea of how to go about
this.

Can any SQL genius help me out?
I'll give you a biscuit and a cup of tea (this may be a lie!)

Thank you!!

Martyn


DISCLAIMER: The information in this email is confidential and may be legally
privileged. It is intended solely for the addressee. Access to this email by
anyone else is unauthorised. If you are not the intended recipient, any
disclosure, copying, distribution or any action taken or omitted to be taken
in reliance on it, is prohibited and may be unlawful.





More information about the thelist mailing list