I thought I had an SQL count searching for a "Today" coded correctly, but I keep getting a 0 count back.
Using Access Database, date format at dd/mm/yyyy
I have this:
I then have this as the SQL:Code:<% Function MyDate() Dim dteCurrent, dteMonth, dteDay, dteYear dteCurrent = Date() dteDay = Day(dteCurrent) dteMonth = Month(dteCurrent) dteYear = Year(dteCurrent) MyDate = dteDay& "/" & dteMonth & "/" & dteYear End Function response.write MyDate %>
But I am getting is "0" where I am actually calling TodayApp is displayed on the page - when it actually should be a number over "0".Code:'Response.write(SQL1) set rs1 = MyConn.execute("Select COUNT(*) as tpt from ppt_table where date_of_ppt="&MyDate&"") if rs1.EOF = false then TodayApp = rs1("tpt") else TodayApp = 0 end if set rs1 = Nothing response.write TodayApp
Any ideas?



Reply With Quote






Bookmarks