Please help-sql query error

Hi guys please assist here:
Error: Run query: Error converting data type varchar to float.

This is the error I get on sql when I run it because it’s trying to get a value but it’s null, how do i handle it on my flow
image

Here is the error in sql:
image

You can’t have two Where clauses. You use logical operators to have more than one, for example:

Where [Product Code] = '1920' AND [Campaign Code] = 'HCCFUNNP519'

The first error is because ‘1920’ is a string (varchar) but it seems that Product_Code in the database is float (numeric). Try…

Where [Product Code] = 1920 AND [Campaign Code] = 'HCCFUNNP519'

1 Like

Oh that was mistake i had where and ‘and’…
But when execute it’s giving same error
image

This is what the table looks like, when I look at it on the campaign code column the value is null there:

image

The NULLs are probably the issue. It has been a long time since I’ve worked with SQL so I can’t remember how to handle this.

Maybe…

Where [Product Code] = 1920 AND [Campaign Code] IS NOT NULL AND [Campaign Code] 'HCCFUNNP519'

1 Like
SELECT *
FROM 
    YourTableName
WHERE 
    [Product Code] = 1920 
    AND [Campaign Code] IS NOT NULL 
    AND [Campaign Code] = 'HCCFUNNP519';

1 Like

Just noticed the issue on my side,it’s when I was importing from excel file to the database the values that are ‘NULL’ on the database are the alphanumeric values on excel file, so when it was importing it only took the numeric values:

This is the excel file:

If I look at the database:
image
Which is why I was puzzled because I had tested in excel and it worked

but this worked thanks

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.