Results 1 to 2 of 2

Thread: converting nvarchar value to a column of data type int ? [Resolved]

  1. #1

    Thread Starter
    Lively Member Naomi1's Avatar
    Join Date
    Oct 2002
    Posts
    113

    converting nvarchar value to a column of data type int ? [Resolved]

    If my [Customer Total] field is '530' the folllowing statement works fine:
    VB Code:
    1. rs.Open "Select SUM (Cast([Customer Total] as Integer)) as TOTAL From Paid WHERE Customer = '" & strText & "'", cn
    but if the [Customer Total] is '530.68' i get the following error:
    [Syntax error converting the nvarchar value '530.68' to a column of data type int.]

    Any ideas ?
    Last edited by Naomi1; Apr 10th, 2004 at 03:52 PM.

  2. #2

    Thread Starter
    Lively Member Naomi1's Avatar
    Join Date
    Oct 2002
    Posts
    113
    Changed it to this:

    VB Code:
    1. rs.Open "Select SUM (Cast([Customer Total] as Money)) as TOTAL From Paid WHERE Customer = '" & strText & "'", cn

    It works.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width