Solved

ms access date sort

Posted on 2012-03-12
1
372 Views
Last Modified: 2012-06-21
I have form with a start date and end date field.  I have a query that looks at these dates to sort the query.

I have the query group by date and format the date to show the date only (removing the time).

When I select date in 2010 it works fine - If I put dates from 2011 the records don't show up on the query.

I'm not sure what is going on.

Any suggestions?  Query below:

SELECT Format([DateStampPun],"mm/dd/yyyy") AS JobDate, JobsDoors.ProjectNo, Count(JobsDoors.ProjectNo) AS [Count]
FROM JobsDoors INNER JOIN DoorTagLog ON JobsDoors.ID = DoorTagLog.BatchID
GROUP BY Format([DateStampPun],"mm/dd/yyyy"), JobsDoors.ProjectNo
HAVING (((Format([DateStampPun],"mm/dd/yyyy")) Between [Forms]![MainForm]![SDate] And [Forms]![MainForm]![EDate]) AND ((JobsDoors.ProjectNo) Is Not Null))
ORDER BY Format([DateStampPun],"mm/dd/yyyy");
0
Comment
Question by:johnmadigan
[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
1 Comment
 
LVL 61

Accepted Solution

by:
mbizup earned 500 total points
ID: 37711282
Try formating your dates as yyyy-mm-dd for proper sorting
0

Featured Post

Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SP result not being displayed 5 67
Routing Issue 26 64
T-SQL: Number of Records is Greater Than One 7 50
Set a variable value in SQL Procedure 3 26
Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
Getting hacked is no longer a matter or "if you get hacked" — the 2016 cyber threat landscape is now titled "when you get hacked." When it happens — will you be proactive, or reactive?
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…

737 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