daisy_polly
06-04-2007, 09:13 PM
Hi,
I am getting the " no value given for one or more".... error. I get the error as soon as i put the date functions in the query.
<%
Dim storeMonth
'Opening a text file to get the month
Set fs=Server.CreateObject("Scripting.FileSystemObject")
Set f=fs.OpenTextFile(Server.MapPath("settings.dat"), 1)
storeMonth=f.readall
'Done reading
Set rscount = Server.CreateObject("ADODB.Recordset")
' Initialization '
cnstring = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source = " & Server.MapPath("data1.mdb")
sqlquery = "SELECT Count(id) as temp FROM data where Month(Date_Recv)=Month(Date()) and Year(Date_Recv)=Year(Date())"
' Open the connection and populate the recordset '
rscount.open sqlquery,cnstring
' Test if there are any records '
If not rscount.eof then
' Move to the first record'
rscount.MoveFirst
Response.Write "<tr><td>"& storeMonth& "</tr></td>"
While rscount.EOF = false
Response.Write "<tr><td>" & rscount.Fields("temp").Value & "</td></tr>"
rscount.movenext
Wend
end if
' Close the recordset / connection '
rscount.close
' Garbage collection / memory management'
set rscount = nothing
f.Close
Set f=Nothing
Set fs=Nothing
%>
thanks in advance to anyone who helps.
DA
I am getting the " no value given for one or more".... error. I get the error as soon as i put the date functions in the query.
<%
Dim storeMonth
'Opening a text file to get the month
Set fs=Server.CreateObject("Scripting.FileSystemObject")
Set f=fs.OpenTextFile(Server.MapPath("settings.dat"), 1)
storeMonth=f.readall
'Done reading
Set rscount = Server.CreateObject("ADODB.Recordset")
' Initialization '
cnstring = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source = " & Server.MapPath("data1.mdb")
sqlquery = "SELECT Count(id) as temp FROM data where Month(Date_Recv)=Month(Date()) and Year(Date_Recv)=Year(Date())"
' Open the connection and populate the recordset '
rscount.open sqlquery,cnstring
' Test if there are any records '
If not rscount.eof then
' Move to the first record'
rscount.MoveFirst
Response.Write "<tr><td>"& storeMonth& "</tr></td>"
While rscount.EOF = false
Response.Write "<tr><td>" & rscount.Fields("temp").Value & "</td></tr>"
rscount.movenext
Wend
end if
' Close the recordset / connection '
rscount.close
' Garbage collection / memory management'
set rscount = nothing
f.Close
Set f=Nothing
Set fs=Nothing
%>
thanks in advance to anyone who helps.
DA