------=_NextPart_000_0012_01BFB237.EAD164C0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Assuming your datestart and dateend are of type Date, then your date =
values should be surrounded by the # character.
Your SQL Statement would then look like this :
sql=3D"SELECT Sum([AcctSessionTime]) AS [SumDuration] FROM [calls] =
WHERE UserName=3D'"_=20
& username & "' AND CallDate >=3D #" & datestart & "# AND =
callDate <=3D #" &_=20
dateend & "#"=20
- Danny Sinang
----- Original Message -----=20
From: Mike Kovacich=20
To: radiusnt@iea-software.com=20
Sent: Saturday, April 29, 2000 8:35 PM
Subject: [RadiusNT] Data Mismatch in CallDate
I recently converted from text logs being imported to an access database =
table called call-logs to radius accounting which of course puts the =
date into "Calls". The text logs had date and time in separate fields =
and lookups were fast. Radius accounting has date and time together. The =
SQL statement I'm using gives me a mismatch error if the field type for =
CallDate in the Calls table is set to "Date" I use asp code for all =
customer account maintenance and have made sure the datestart and =
dateend are date types. If CallDate is set to text it works but VERY, =
VERY slow as compared to when date and time were is separate fields. =
I've already isolated other lookups and verified it is the date =
parameter causing the problems.=20
sql=3D"SELECT Sum([AcctSessionTime]) AS [SumDuration] FROM [calls] =
WHERE UserName=3D'"_=20
& username & "' AND CallDate >=3D '" & datestart & "' AND =
callDate <=3D '" &_=20
dateend & "'"=20
Even this simpler statement give the mismatch error:=20
sql=3D"SELECT Sum([AcctSessionTime]) AS [SumDuration] FROM [Calls] WHERE =
CallDate >=3D '" & datestart & "'"=20
examples of datestart and dateend are as follows"=20
datestart =3D "2000-03-01"=20
dateend =3D "2000-03-31"=20
I know CallDate should be a date type but if it is set to that, searches =
via dates give the " Data type mismatch in criteria expression" =
message. I know, I know upgrade to SQL 7 but haven't been able to do =
that yet. Short of writing a script to convert the radius accounting =
records to the old table for customer and internal accounting usage.=20
I have the CallDate type set to text in ServerPorts which is probably =
why it doesn't get updated as well. Any assistance would be appreciated. =
--=20
Mike Kovacich=20
=20
------=_NextPart_000_0012_01BFB237.EAD164C0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
sql=3D"SELECT Sum([AcctSessionTime]) AS=20[SumDuration] FROM [calls] WHERE UserName=3D'"_
& username & "' =AND=20CallDate >=3D #" & datestart & "# AND callDate <=3D =#"=20&_
dateend =&=20"#"
sql=3D"SELECT Sum([AcctSessionTime]) AS=20[SumDuration] FROM [calls] WHERE UserName=3D'"_
& username & "' =AND=20CallDate >=3D '" & datestart & "' AND callDate <=3D '" =&_=20
dateend & ="'"=20
Even this simpler statement give the mismatch =error:=20
sql=3D"SELECT Sum([AcctSessionTime]) AS =[SumDuration] FROM=20[Calls] WHERE CallDate >=3D '" & datestart & "'"=20
examples of datestart and dateend are as follows"
datestart =3D=20"2000-03-01"
dateend =3D "2000-03-31"=20
I know CallDate should be a date type but if it is set to that, =searches via=20dates give the " Data type mismatch in criteria expression" =message. I=20know, I know upgrade to SQL 7 but haven't been able to do that yet. =Short of=20writing a script to convert the radius accounting records to the old =table for=20customer and internal accounting usage.=20
I have the CallDate type set to text in ServerPorts which is probably =why it=20doesn't get updated as well. Any assistance would be appreciated.
-- =
Mike Kovacich