Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Need a Quick SQL Query

Posted on 2011-02-22
4
Medium Priority
?
250 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 1000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

618 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