Solved

Need a Quick SQL Query

Posted on 2011-02-22
4
247 Views
Last Modified: 2012-05-11
One Table called Orders.

ORDERID, ORDERDATE, SHIPSTREET, SHIPCITY, SHIPZIPCODE

I need to return all fields where
ORDERDATE BETWEEN  #1/1/2011# and #1/31/2011#
AND
COUNT(SHIPSTREET) > 1

Thanks

0
Comment
Question by:LanBuddha
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 18

Expert Comment

by:sventhan
ID: 34954913
select ORDERID, ORDERDATE, SHIPSTREET, SHIPCITY, SHIPZIPCODE
from orders
where ORDERDATE BETWEEN  '2011-01-01' and '2001-01-13'  
and count(shipstreet) > 1
0
 
LVL 18

Expert Comment

by:sventhan
ID: 34954932
select ORDERID, ORDERDATE, SHIPSTREET, SHIPCITY, SHIPZIPCODE
from orders
where ORDERDATE BETWEEN  '2011-01-01' and '2001-01-13'  
group by ORDERID, ORDERDATE, SHIPCITY, SHIPZIPCODE
having count(shipstreet) > 1
0
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 250 total points
ID: 34954990
if you will run this in access


SELECT  OrderID, OrderDate, ShipStreet, ShipCity,ShipZipCode
FROM Orders
WHERE (((ShipStreet) In (SELECT [ShipStreet] FROM [Orders] As Tmp GROUP BY [ShipStreet] HAVING Count(*)>1 )) AND ((OrderDate) Between #1/1/2011# And #1/31/2011#))

0
 
LVL 2

Author Closing Comment

by:LanBuddha
ID: 34955104
Access chokes a little on this but return a result.

thanks much.
0

Featured Post

Backup Solution for AWS

Read about how CloudBerry Backup fully integrates your backups with Amazon S3 and Amazon Glacier to provide military-grade encryption and dramatically cut storage costs on any platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question