It would seem that isDate and dateFormat assume that 08/009 is 08/09/2009.
I did a quick search for some regex to check a date format and put together the test code below.
As a note :
1) I'm sure you have your reasons, but there does seem to be an overuse of the session scope. Check your date and then put it into the session when you have a valid date.
2) You most likely don't need the urlencodedformat() around your date in the strQuery (which might actually be what is breaking your SQL)
3) You really should be protecting your application from SQL Injection at a minimum by using cfqueryparam in your SQL. Rather than dynamically generating SQL statements try to write specific components/functions that you pass params into and call well built and protected SQL calls.
Main Topics
Browse All Topics





by: Dain_AndersonPosted on 2009-09-09 at 05:53:13ID: 25290636
I'm not sure I understand what's wrong here. The date mask, mm/yyy, is perfectly valid, and so long as you format it to a more database-friendly format (which you are), you should be fine without the database erring. I'm guessing you're using the variable form.frmDate in your SQL statements, and if so, try the code attached.
HTH,
-Dain
Select allOpen in new window