Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone,
Thank you in advance for your time in answering this question.
How does QV know how to apply a criteria of '>=' to a date string independently of the formats? As these are basically different strings (image 1 and 2), shouldn't they give different results?
P.S. I know date is a formatting function but still the script registers it as a string.
image 1
Image 2
The simple answer is that Dates are not strings, they are Dual type. They have both a numeric value (the number of days since Dec 30, 1899) and a formatted string representation. QV is smart enough to use either the numeric or string format depending on the context. For example, when you do a comparison expression, the numeric value is used. When you put the field in a listbox, the string is used.
-Rob
What is the difference between the two images? Also, your date format should be DD/MM/YYYY and not 30/08/2017
Sorry, my bad, I just corrected the post
Why would you expect to get different results? You are using same date in two formats? Personally, I prefer to use MakeDate() function when do comparisons with date field
Where Bill_Date >= MakeDate(2017, 8, 30);
The simple answer is that Dates are not strings, they are Dual type. They have both a numeric value (the number of days since Dec 30, 1899) and a formatted string representation. QV is smart enough to use either the numeric or string format depending on the context. For example, when you do a comparison expression, the numeric value is used. When you put the field in a listbox, the string is used.
-Rob