Discussion Locked

2 SQL Server 7.O error messages.

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi,

I'm trying to recreate an Access(.mdb) query in SQL and I'm getting the following error message in SQL: "Divide by 0 error encountered." without any obvious reason. The same query works fine in Access.

Also when trying to use the aliases of the columns in a SQL query to create calculated columns in the same view, SQL wouldn't let me do that. Any ideas?

Thanks,

Boris

5 replies

by 3wadman

I would need to see the SQL to be sure but... this is most typical:
convert * to %
like "%main st%"
Take out all the extra ((('s and all the ;
Make sure your inner and outer joints are correctly paired with left and right joints.
LEFT OUTER JOIN;INNER JOIN;
You must us DISTINCT TOP 100 PERCENT and not just TOP 100.
Joins should look like: Products.idProduct = DepartmentProducts.idProduct

by fofa

Wildcard character in SqlServer is % instead of *, but that shouldn't give a divide by error. Since you have a calculated column, we would need to see the Sql to be sure. Also column alias in Sql is, column as ALIASNAME rather than access's ALIASNAME: column.

by Former member

This question was closed by the author

This discussion is closed to new replies.