YTD Sales

Dman

Active Member
Licensed User
Longtime User
I am trying to get a figure on my year to date sales. I am using the statement below but it gives me a null value.

B4X:
   Dim mtdsales As String
   mtdsales = SQL1.ExecQuerySingleResult("SELECT sum(total) FROM invoice WHERE strftime('%Y', date) = 2012")



I am calculating my date with

B4X:
    DateTime.DateFormat = "MM/dd/yyyy" 
        today = DateTime.Date(DateTime.now)

Do I need to format it differently? Or start all over? :)
 
Last edited:

Dman

Active Member
Licensed User
Longtime User
I got it figured out I think.

I have an unused field in my db so I parsed the date and inserted it into the unused field and it seems to work. At least on all of the new records anyway. :)
 
Upvote 0
Top