Solved

ms access date sort

Posted on 2012-03-12
1
366 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
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Quality of Service (QoS) options are nearly endless when it comes to networks today. This article is merely one example of how it can be handled in a hub-n-spoke design using a 3-tier configuration.
Shadow IT is coming out of the shadows as more businesses are choosing cloud-based applications. It is now a multi-cloud world for most organizations. Simultaneously, most businesses have yet to consolidate with one cloud provider or define an offic…
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…

743 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now