mar...@gmail.com wrote:
> I am trying to select all the entries between the first and the last
> of any given month, but I am experiencing a data type mismatch as you
> can see.
Well ... no ... I cannot see. I'm not looking at your screen. Which line
generates the error?
> The format of the dates are dd.mm.yyyy.
The format of the date is irrelevant. Access stores dates as Decimals, with
the whole number portion representing the number of days since the seed
date, and the decimal representing the time of day.
> I have been banging
> my head into my desk for some time now trying to figure this out. Can
> anyone see anything wrong here?
>
> viewPort = Request.QueryString("view")
>
> Select Case viewPort
> Case "category"
> sSQL = "SELECT * FROM blog_entries WHERE category = '" &
> Request.QueryString("category") & "'"
> Case "archive"
> dtmArchiveMonthBeginsOn = Request.QueryString("when")
> dtmArchiveMonthEndsOn = DateAdd("d",
> (LastOfTheMonth(dtmArchiveMonthBeginsOn)-1), dtmArchiveMonthBeginsOn)
> sSQL = "SELECT * FROM blog_entries WHERE created BETWEEN '" &
> dtmArchiveMonthBeginsOn & "' AND '" & dtmArchiveMonthEndsOn & "'"
You cannot debug a sql statement without knowing what it is. Use
Response.Write SQL
to make the sql statement being passed to Access visible.
The goal with dynamic sql is to create a string that can be copied and
pasted into the SQL View of an Access Query Builder window and run as-is.
Show us the string your concatenation generates.