Joshua_1

Date Format In SQL

Discussion created by Joshua_1 on Apr 25, 2017
Latest reply on Apr 25, 2017 by greglane

Hi,

 

I am trying to retrieve sales data for the last 90 days but I'm running into formatting issues. SQL's format is YYYY-MM-DD while Get(CurrentDate) is MM-DD-YYYY. My SQL statement is as follows:

 

ExecuteSQL("SELECT SUM(subTotal) FROM Orders WHERE CustomerID = ? AND OrderDate > ?"; ""; ""; Customers::CustomerID; Get(CurrentDate) - 90)

 

but because the formatting are different... it's not working. What is the simplest correct way that I should be executing this SQL statement?

 

I have:

Filemaker Pro 13 Advanced

Windows 7

 

Thanks In Advance!

Outcomes