Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Really need somebody's help! (urgent!)
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

5 Posts

Posted - 07/17/2011 :  05:06:29  Show Profile  Reply with Quote
bob march 3 2011 1
bob june 6 2008 2
bob jan 3 2012 3
mary feb 14 1986 4
mary april 10 2001 5
mary jan 3 2012 6
kate march 3 2011 7
kate jan 3 2012 8
kate oct 9 2013 9
celia march 3 2011 10
celia feb 14 1986 11
celia july 4 2011 12
celia jan 3 2012 13
celia feb 14 1991 14

So the goal is we add the amount of presents kate and celia got on the same days if they got any on the same days

What I need to do is kind of like this except with a much bigger data set. Prolly in the 100 000 entries.
i need the answer in SQL code   or access 2003 query SQL.


Flowing Fount of Yak Knowledge

South Africa
4507 Posts

Posted - 07/17/2011 :  06:55:49  Show Profile  Visit GilaMonster's Homepage  Reply with Quote
Looks like a reasonably simple sum with group by. What have you done so far?

Gail Shaw
SQL Server MVP
Go to Top of Page

Flowing Fount of Yak Knowledge

6065 Posts

Posted - 07/17/2011 :  11:49:42  Show Profile  Reply with Quote
I'm curious - what is the nature of the urgency? Are you in the process of taking a test or in a job interview or something?

Be One with the Optimizer
Go to Top of Page

Starting Member

5 Posts

Posted - 07/19/2011 :  05:18:24  Show Profile  Reply with Quote
to GilaMonster and TG. I'm a student on a summer job and my job has a lot of programming aspects and data management. Its also my first time dealing with ms access and excel languages so I've been googling and consulting forums. This is an example I made up that is related to something I need for work. and i have learnt to do macros in excel but sql in access is giving me a real tough time. I was asked to do a query to have access do this for me. but i dont think i can set all the criteria right for one query so i was thinking i might need subqueries and eventually resulted to using sql with which i have no experience.

If you can explain more in depth of this simple sum and group by or an example code that would be great. anythign would be great rly! ive been googling for two days getting no where >.> Thank you!
Go to Top of Page

Transact Charlie
Flowing Fount of Yak Knowledge

United Kingdom
3451 Posts

Posted - 07/19/2011 :  06:40:38  Show Profile  Visit Transact Charlie's Homepage  Reply with Quote
"Really need somebody's help! (urgent!)"

Nope. You don't.
Your database is still intact. The server is not on fire.

It is a simple question. People don't respond well to urgent posts that are not urgent.

The query would look something like:

    [NAME] AS [Name]
    , [DATE] AS [Date]
    , SUM([PRESENTS]) AS [Total Presents]
    , [DATE]

Also -- [DATE] are really bad names for columns. 1)DATE is a keyword. 2) Which / What date does it represent.

Msg 3903, Level 16, State 1, Line 1736
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000