D Dman Active Member Licensed User Longtime User Sep 4, 2012 #1 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. Code: Copy Dim mtdsales As String mtdsales = SQL1.ExecQuerySingleResult("SELECT sum(total) FROM invoice WHERE strftime('%Y', date) = 2012") I am calculating my date with Code: Copy DateTime.DateFormat = "MM/dd/yyyy" today = DateTime.Date(DateTime.now) Do I need to format it differently? Or start all over? Last edited: Sep 4, 2012
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. Code: Copy Dim mtdsales As String mtdsales = SQL1.ExecQuerySingleResult("SELECT sum(total) FROM invoice WHERE strftime('%Y', date) = 2012") I am calculating my date with Code: Copy DateTime.DateFormat = "MM/dd/yyyy" today = DateTime.Date(DateTime.now) Do I need to format it differently? Or start all over?
D Dman Active Member Licensed User Longtime User Sep 4, 2012 #2 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
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.