Hi, I have a sql statement which was running fine yesterday. After making a few changes to the website, it stopped working. I managed to get the statement work on my localhost, however, when I publish the same pages onto the server, I receive the "Operand should contain 1 column(s)" error.
I have a table names "PLZ" with a column also called "PLZ". The statement that worked was the following (just an example):
SELECT DISTINCT PLZ FROM PLZ WHERE
(PLZ_LNG <= (13.4 + 0.154103006104881) AND PLZ_LNG >= (13.4 - 0.154103006104881))
AND
(PLZ_LAT <= (52.517 + 9.62081932126399E-02) AND PLZ_LAT >= (52.517 - 9.62081932126399E-02))
AND
PLZ <> '14131'
AND
PLZ_LNG <> 0
AND PLZ_LAT <> 0
ORDER BY PLZ ASC;
On my localhost I changed the statement to the following in order to prevent mixing up the column names, and it worked fine:
SELECT DISTINCT PLZ.PLZ FROM PLZ WHERE (PLZ.PLZ_LNG <= (13.4 + 0.154103006104881) AND PLZ.PLZ_LNG >= (13.4 - 0.154103006104881)) AND (PLZ.PLZ_LAT <= (52.517 + 9.62081932126399E-02) AND PLZ.PLZ_LAT >= (52.517 - 9.62081932126399E-02)) AND PLZ.PLZ <> '14131' AND PLZ.PLZ_LNG <> 0 AND PLZ.PLZ_LAT <> 0 ORDER BY PLZ.PLZ ASC;
Now, when I publish the same statement onto the server, I get the same operand error again. I tried changing the statement by adding () between the AND statements and whatever I thought maybe helpful, but on the server this statement is not working :(
I would appreciate any suggestions, which may help me to solve this problem.
Regards,
Ali Baradaran