Cannot change the date format to the first record - google-sheets-query

Data are captured from Google Form and the first column is the Timestamp, I want to query it and only show all unique date for further use.
Formula
=UNIQUE(QUERY(A2:A, "SELECT A format A 'dd-mmm-yyyy'", 1)
only the first record cannot be formatted, is it a bug or something wrong to my formula?

Remove the header argument '1'.
Query should look likes this:
=unique(QUERY(A2:A, "SELECT A format A 'dd-mmm-yyyy'"))
Here is working result:

Related

MS Access Form to Query with Date Ranges (And Even Without)

I'm new to Access and I'm building a database here at work to log all production that was done. I was able to make a query form with criteria between a date range, condition, part number and work order. Using a code in the expression builder, these are what is placed in the criterion:
Date range: Between [Forms]![Form Query]![BeginDate] And [Forms]![Form Query]![EndDate]
Part number: Like (IIf(IsNull([Forms]![Form Query]![Part Number]),"*",[Forms]![Form Query]![Part Number]))
Condition: Like (IIf(IsNull([Forms]![Form Query]![Condition]),"*",[Forms]![Form Query]![Condition]))
This is where even when part numbers and condition is empty, the query will display all records. My problem is the date range if I leave it empty (say, I simply wanted to query all of the records), it will return with zero value. I wanted it to make it simple for the user that if I leave the date range empty, it will still show all of the records. I had to temporarily put the date range as required to always return results.
Query form
Query Criteria
All input is appreciated! Thank you so much!
Provide alternate value if date is not input:
Between Nz([Forms]![Form Query]![BeginDate], #1/1/1900#) And Nz([Forms]![Form Query]![EndDate], #12/31/2200#)
For text fields, assuming value is unique and is never part of a longer string, LIKE criteria can just concatenate wildcard:
LIKE [Forms]![Form Query]![Part Number]) & "*"

How to highlight cell if date format is incorrect or blank?

I have an excel sheet with over 5000+ records.
I am trying to set the date column into correct format (dd/mm/yy)
Instead of visually looking at data to spot errors such as:
Blanks
Date inputted like this: 27//01/20 < notice the double //
Or something like this: 27/01/20.. < notice the full stops
Is there an easier way of finding errors in date column?
Here is a sample of my column A:
1st and 4th row should be marked in red, because it is not correct format.
Reason I want to achieve is this is because I am needing to import it into MySQL with correct column types. Not all to be varchar.
Use conditional formatting - choose rule type 'Use formula...', enter formula =NOT(ISNUMBER($A10)) for appropriate range and get red cells.

Access Period Sort

I am attempting to pull records from a specific period into a form. I need to be able to pull the information from a date field within a table to put into the form. I need it to prompt for a date range and that date range show in the form/report. I am having trouble making this work.
Thanks
The following is an example of selecting a date range using parameters that you specify. It will prompt you to enter a start and end date
AND it will return the dates you selected as fields in the query.
You can use the start/end fields in your form/report.
SELECT [Table1].*, [StartDate] AS MyStart, [EndDate] AS MyEnd
FROM Table1
WHERE ((([Table1].DateAdded) Between [StartDate] And [EndDate]));

MS Access - Use result from query to calculate field value

I'm trying to pull some data from a query in my database into a calculated field in a table. I have dates entered for some jobs I'm recording (DateCallOpened, DateQuoteSent, DateQuoteReceived), as well as WorkType for each job to track the type of work done. I've used calculated fields to find the time it took for each record between those dates. I've also used qryTimings to find the average length of time for the WorkType.
I'd like to build fields that showed the ProjectedQuoteSent, and use the data from my query to calculate the date I can expect the quote to be sent, but I just can't figure out how to pull that data out of the query. I was hoping it would be something as simple as:
=[DateCallOpened]+[qryTimings]:[Avg Of TimeToSendQuote]
You can use a DLookup() function to grab your value from your query. So your formula would be something like:
=[DateCallOpened]+DLookup("Avg Of TimeToSendQuote", "qryTimings", _
"[WorkType]=" & [Forms]![frmMyForm]![txtWorkTypeInput])
See this for more info.

Showing Date in a specific format

I need to make the date format that I entered into the database look exactly the same as when i view it. Eg. Currently my format is 2013-12-21, but when i view it, it shows 12/21/2013. It's quite confusing because when I edit the date in my form, it's in the 12/21/2013 format and the database wont accept it when i change the date to something like 12/23/2013. Please help. Thanks
(btw, it just auto formatted my date. I didn't even use the <%formatdatetime%> function.)
EDIT: Sorry for the lack of information guys. This is what's happening.
1. I created a form to add date amongst othes to mysql. Eg. Purchase date, item, etc (sql wants it in yyyy-mm-dd format and that's how i enter it.
2. created a view list to select which rows i want to update. (Used
<%=Formatdatetime(f_purchasedate,2)%>
to show date only without time as it was 12/21/2013 12:00:00 AM)
3. created an update form.
Now the problem is it shows the date as 12/21/2013 instead of 2013-12-21. So when i submit the form after altering other fields, it says date error. I have to manually type the format 2013-12-21 for all my dates before i can submit the form.
i'm guessing it has something to do with this line of mine.
purchasedate.Text = ODBCdataset.Tables("tbl_vm").Rows(0).Item(2)
tried this but it doesnt help either...
formatDateTime('purchasedate').Text.ToString("yyyy-MM-dd") = ODBCdataset.Tables("tbl_vm").Rows(0).Item(2)
You can use DATE_FORMAT(date,format)
Select DATE_FORMAT('Your Date Value'),%Y-%m-%d) as Date from table_name
Or
You can pass the value to a variable like below
purchasedate.Text = CType(ODBCdataset.Tables("tbl_vehiclemanagement").Rows(0).Item(2).ToString, DateTime).ToString("yyyy/mm/dd")
Dim date As String = DateTime.Now.ToString("yyyy/mm/dd")