Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: gsamm
  • Order by date
  1. gsamm

    date in form ddmmyyyy needs simple valid/invalid test

    This is what I have ended up with... function MM_Validate() { strError = "There appears to be a problem with some of the data you input:\n\n" var yearToCheck = document.formproject01.completedateyy.value; var monthToCheck = document.formproject01.completedatemm.value - 1; var dateToCheck =...
  2. gsamm

    date in form ddmmyyyy needs simple valid/invalid test

    I have three listboxes for a date - day,month and year. The day listbox has values 1-31 The Month listbox has values 1-12 The Year listbox has values 2005-2010 I concatonate these values and pass them to a database, so I have control over the format. This works fine until you select...
  3. gsamm

    ASP MS Access Date in Where clause returns unexpected values

    DNG, Thanks for the help. Bouncing the code around for a while was really useful. It sometimes helps just to get someone to confirm that you are not doing anything really silly.
  4. gsamm

    ASP MS Access Date in Where clause returns unexpected values

    OK, here is the answer! the code: v_comparedate = (Month(Date))&"/"&(Day(Date))&"/"&(Year(Date)) SQL = "SELECT * FROM Project Where CloseDate > #" & v_comparedate & "#;" The result: it works! Therefor: Everything is stored correctly in access in dd/mm/yyyy format. When you use...
  5. gsamm

    ASP MS Access Date in Where clause returns unexpected values

    STOP PRESS! I know why it is not working: Although the date is stored in access as dd/mm/yyyy it is still being passed back to the ASP page as mm/dd/yyyy. I found this out by hard coding the date into the SQl string: the code: SQL = "SELECT * FROM Project Where CloseDate > #06/06/2005#;"...
  6. gsamm

    ASP MS Access Date in Where clause returns unexpected values

    Yep, I'm afraid I've already tried it. I will double check though just in case... ...nope, still fails to weed out those future dates. There is something very screwy going on here. I just can't understand why the dates appear to be being compared as strings rather than dates.
  7. gsamm

    ASP MS Access Date in Where clause returns unexpected values

    DNG, No mate, the code looks like this: SQL = "SELECT * FROM Project Where DateValue(CloseDate) > #"& DateValue(Date()) &"#;" response.Write("date = ") response.Write(date) response.Write("<br>") response.Write("SQL = ") response.Write(SQL) Set RS_Project00 = objConn01.Execute(SQL)...
  8. gsamm

    ASP MS Access Date in Where clause returns unexpected values

    Haha - nothing :( the code: SQL = "SELECT * FROM Project Where DateValue(CloseDate) > #"& DateValue(Date()) &"#;" response.Write("date = ") response.Write(date) response.Write("<br>") response.Write("SQL = ") response.Write(SQL) the output: SQL = SELECT * FROM Project Where...
  9. gsamm

    ASP MS Access Date in Where clause returns unexpected values

    Hmmm, It looks like Access doesn't support the convert function: Microsoft JET Database Engine (0x80040E14) Undefined function 'CONVERT' in expression. It looks as though it is interpreting the 'dd' part of the date first and obviously thinks that '29' is greater than '02'. OK but that still...
  10. gsamm

    ASP MS Access Date in Where clause returns unexpected values

    Just as an aside, I am using the driver: Connection = "PROVIDER=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & Server.MapPath("/cands/database/project.mdb") I have also tested it with the ODBC driver and it produces the same result.
  11. gsamm

    ASP MS Access Date in Where clause returns unexpected values

    OK, This is the code that I am now using to check: SQL = "SELECT * FROM Project Where CloseDate > #"& Now() &"#;" response.Write("date = ") response.Write(date) response.Write("<br>") response.Write("SQL = ") response.Write(SQL) The output I get is: date = 02/06/2005 SQL = SELECT * FROM...
  12. gsamm

    ASP MS Access Date in Where clause returns unexpected values

    Hmmm, I have just ried that and it still retrieve everything, regardless of the date. The code now reads: SQL = "SELECT * FROM Project Where CloseDate > #"& Now() &"#;"
  13. gsamm

    ASP MS Access Date in Where clause returns unexpected values

    I am building a web site in ASP using MS Access as the database (for the time being) I excecute the following SQL query to retrieve records that are still 'open' (e.g the CloseDate must be in the future) SQL = "SELECT * FROM Project Where CloseDate > #" & Date() & "#;" This statement returns...

Part and Inventory Search

Back
Top