Data Type Mismatch

Results 1 to 2 of 2

Thread: Data Type Mismatch

  1. #1
    XAcem Guest

    Default Data Type Mismatch

    I&#039m Trying To Write A BBS Script But I AM Having Problems IN Writing The SQL Statements. Now I Am Trying TO Write Statement That Will Open The able Forum And Then Only Show The Recordsets With The Current Date I The Date Field. I Tried To Do This On My Own And It Kept O Saying That There Was A Data Type Mismatch. Could Someone Please Help Me??<BR><BR>Thanks In Advance,<BR><BR>Mat

  2. #2
    Kevin Guest

    Default RE: Data Type Mismatch

    Dates can be very tricky and there are many variances on different databases. If the date field in the database is Date/Time, then you have that to worry about also. Try something like this.<BR><BR>&#039 Get today&#039s date and current time<BR>theDate = Now()<BR><BR>&#039 Extract the month, day, and year.<BR>theMonth = Month(theDate)<BR>theDay = Day(theDate)<BR>theYear = Year(theDate)<BR><BR>&#039 Build your SQL string<BR>sql = "SELECT * FROM myTable WHERE dateField &#062;= &#039" & theMonth & "/" & theDay & "/" & theYear & "&#039"<BR><BR>That should return all records with todays date.<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts