Sort differing date formats in Access? - ms-access

I have an Access database in which a report is pulled and displayed based on city and state. There is a form where the user selects city and state and a query is run, then a report displayed based on that query. I want to sort the data from the query by Warranty Start date(WSD) then Model #. The problem is that all of the dates aren't in the same format and if I try to format the WSD column as a date field Access Deletes at least 1000 records. Currently all fields are formatted as short text. Is there a way that I can sort the data by date without the format being the same for all? I have attached a screenshot of some records to show the issue.
If you need the sql query I can provide that as well.

If you wish to sort by the date, then you can use:
IIf(IsDate([WSD]), CDate([WSD]), DateSerial(Val([WSD]),1,1)) AS WarrantyDate

Related

Quick filter doesnt show right results when I filter date field whose format I changed to \Wyyww

I changed the format to date fields to "W"yyww, and the results show as expected. However, when I try to use the quick filter to show all data for a specific week, it only shows data for one day of the week and disregards the rest.
For example, I filter the data to show W1940, but it only shows data for one of the days in the week.
This happens when I try to filter on the table, related query, and form.
How can I get around this?

How do I store data pertaining to a month or year in Mysql

I receive csv files at the end of each month from my customer for each of their KPI (for example csv's for resumes received, candidates joined, candidates resigned, sales, profits, loss , etc) for that specific month.
I want to be able to query this data inorder to generate reports for any month, day or year. This report will be generated dynamically i.e the admin would specify what rows he would like to have in a report (for eg a report with applications received, applications shortlisted, candidates shortlisted after the 1st interview for the period of jan to july.) for any period of time.
What would be the best way to store the data into my database in order to generate such reports? I am using Mysql as my database.
I am not sure if I would need to flush out the old data from my tables currently. So considering that I keep all the data persistent, what would be the best suited database design for this?
Currently what I do is I have a table for each of their KPI. This table has got a date field which I am using to generate the report. But I am looking for a more optimized way.
Thanks in advance.
It is better to store those values (month or year related values ) in a "Date" type fields which would not need any other manipulation while building reports. The conditions or logic for the specific period of time should be handled in your front end. In this case, the usage of Date field is the optimized way.

Querying based on a data entered in an Access form

I've trying to build a query that will look at various fields that are filled out in an associated form. In particular, I'm looking to query for all records > a certain date. This column in the database is stored as a DateTime. Right now, my query looks as follows: (Note that fromDate is just a textbox.
SELECT * FROM ACM_TABLE where DT_TM>[Forms]![Form1]!fromDate
When I replace this with a hardcoded date in the form mm/dd/yyyy, it returns results, but querying based on what is entered in the form does not. Is there some type of conversion I need to do?
Thanks

How can I view data of specific dates in MS Access DB

I'm using Northwind DB in MS Access I'm facing problem in viewing the data with specific dates. I have created a new form and I want to get the data in the form for my end user. So if he specifies from and till dates the corresponding data should appear in the form.
How it can be done in form ?
Ex. In table dbo_invoices I want to know the order list for specific time I.e ddmmyyyy to ddmmyyyy and display all the elements in the given time.
How can it be done.
Thank you. Your help will be appreciated.
In order to use dates as criteria you should read here :
https://support.office.com/en-ca/article/Examples-of-using-dates-as-criteria-in-Access-queries-aea83b3b-46eb-43dd-8689-5fc961f21762
As for your specific need in the query you should use on the date field
Between [dateFrom] and [dateTo]

How to create a Multiple date picker for a search form

I am quite a newbie to MS Access.I am working with a search form in MS Access and I want to create a date picker in which I can select multiple dates which will be an input for a Query that is used to search and display the results from my table for the records that have the selected dates. I did some research on this,however I was unable to find out a feasible solution for my problem.
As I see there are only 2 ways in which this can be done.The first way is that is using two date pickers one for from date and other for to date and then search for the records between these days which is not very feasible for my scenario as I might want to choose two different dates for example 4th of Jan and 6th of Jan and display results for only those days.
The other method is to use a list box which displays all the dates that are present in the database and choose from that however this is not going to work for me as if I have a very long list of dates such as from 1st Jan to 31st Jan then it would be very time consuming and also I might select a date which I do not want to to search for also in the results.
Could anybody suggest me how can I solve this problem.I am looking for a multiple date picker property in access.Is it possible to achieve this through the form properties? If yes how can it be done? Or is there any other solution for this problem?
Thanks in Advance.
I would recommend creating a temp table consisting of two fields, a Yes/No field and a Date field. Populate the date field (don't name it 'date') with all of the dates from your list of dates. Then on your search form add a subform bound to the temp table. Users would simply check the box next to the desired dates. Then modify your query to include the temp table with a join on the date fields and criteria that the Yes/No field is True (Yes).
Its doubtful youre still looking for this but for anyone else that happens accross this topic I modified an existing datepicker to allow selection of any number of non-contiguous dates, and insert them to a table. I posted it on UtterAccess (A great forum for Access questions). A link to the forum topic is below, but you need to create an account to download the example file.
http://www.utteraccess.com/forum/index.php?showtopic=1738361&st=0#entry2535392
You could combine the two approaches and have
Two textboxes to filter for a short date range (say 1 month dates)
Show the dates in this date range in a multiselect listbox where the user can select the specific dates they need.