Reputation: 350
I was given this line to add to my query from a co-worker but I'm not understanding what it is doing. Unfortunately he is offline and on vacation so I couldn't ask him directly. I ran the query with and without this line and I don't see the difference.
g.fromdos > replace(char(current date - 10 days, iso), '-', '')
Upvotes: 1
Views: 56
Reputation: 753615
Making educated guesses, since the DBMS is not specified:
current date - 10 days
produces the date 10 days ago.char(current date - 10 days, iso)
formats the date in the ISO 8601 format, which looks like "2014-12-13" (given that today is 2014-12-23).g.fromdos
value compares larger than "20141213".Without knowledge of the type of g.fromdos
, it's not possible to say whether the comparison is done as numbers or strings.
Upvotes: 2