Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > mismatch error

Reply
Thread Tools

mismatch error

 
 
abbylee26@hotmail.com
Guest
Posts: n/a
 
      02-22-2006
sSQL = "SELECT [Billing Date], [Service Number], [Subscriber User
Name]," & _
" Fund, Account,[Activity Code], Description, [Total Charge]" & _
" FROM 06_Statements" & _
" WHERE [Billing Date] = '" & Request.Form("cmonth") & "'" & _
" AND [Service Number] = '" & Request.Form("cnumb") & "'" & _
" AND [Total Charge] = '" & Request.Form("camount") & "'"
set rs = Connect.Execute(sSQL)

This query does not work...I get the error message:
Error Type:
Microsoft JET Database Engine (0x80040E07)
Data type mismatch in criteria expression.


If I remove the following line, the statement works fine?
" AND [Total Charge] = '" & Request.Form("camount") & "'"


Request.Form("camount") is a number (.34, 1.2, 9, etc)
the "Total Charge" field in the Access DB is a text field.


I assume I'm comparing apples and oranges. What must I do to get this
to work?

 
Reply With Quote
 
 
 
 
Paxton
Guest
Posts: n/a
 
      02-22-2006

http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> sSQL = "SELECT [Billing Date], [Service Number], [Subscriber User
> Name]," & _
> " Fund, Account,[Activity Code], Description, [Total Charge]" & _
> " FROM 06_Statements" & _
> " WHERE [Billing Date] = '" & Request.Form("cmonth") & "'" & _
> " AND [Service Number] = '" & Request.Form("cnumb") & "'" & _
> " AND [Total Charge] = '" & Request.Form("camount") & "'"
> set rs = Connect.Execute(sSQL)
>
> This query does not work...I get the error message:
> Error Type:
> Microsoft JET Database Engine (0x80040E07)
> Data type mismatch in criteria expression.
>
>
> If I remove the following line, the statement works fine?
> " AND [Total Charge] = '" & Request.Form("camount") & "'"
>
>
> Request.Form("camount") is a number (.34, 1.2, 9, etc)
> the "Total Charge" field in the Access DB is a text field.
>
>
> I assume I'm comparing apples and oranges. What must I do to get this
> to work?


AND [Total Charge] = '" & cstr(Request.Form("camount")) & "'"

/P.

 
Reply With Quote
 
 
 
 
abbylee26@hotmail.com
Guest
Posts: n/a
 
      02-22-2006
Thanks...it worked after I put the sctr() around "[Total Charge]" also.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
type mismatch error amitbadgi@gmail.com ASP .Net 3 08-12-2005 11:23 AM
data type mismatch error amitbadgi@gmail.com ASP .Net 1 08-10-2005 01:04 PM
WORD shutdown - microsoft visual basic Run Time Error 13 - Type Mismatch frodo Computer Support 0 05-20-2004 05:39 PM
firewall policy mismatch error David Carson Cisco 3 01-31-2004 09:46 PM
Fatal Python error: Interpreter not initialized (version mismatch?) - Solution Chris Matuszewski Python 0 08-24-2003 02:59 AM



Advertisments