Page 2 of 2

Re: SQL

Posted: Tue Aug 19, 2014 11:05 am
by NvM
I made a test with your SQL-statment. The only thing is changed is one more "(" and ")":

Your source:

Code: Select all

SELECT Belegnummer, Belegart FROM KHKVKBelege WHERE (Periode = 2014006) AND ((Belegart = 'Sofortrechnung' OR Belegart = 'Direktrechnung' OR Belegart = 'Rechnung'))
My source:

Code: Select all

SELECT Belegnummer, Belegart FROM KHKVKBelege WHERE (Periode = 2014006) AND (Belegart = 'Sofortrechnung' OR Belegart = 'Direktrechnung' OR Belegart = 'Rechnung')
In my case it does not work? What could be another reason?

Re: SQL

Posted: Tue Aug 19, 2014 1:09 pm
by Oleg
I'm sorry. I don't know.
It's necessary to analyze the real data of the table.

I used your SQL query exactly. The query is correct. Otherwise the database engine should return an error.

Re: SQL

Posted: Tue Aug 19, 2014 1:13 pm
by NvM
Maybe I could give you an SQL-Statement, which creates the table structure. Other thing to know is, that every system here is working with english versions. But this - in combination with german region settings - should not make trouble, right?

Re: SQL

Posted: Tue Aug 19, 2014 1:20 pm
by Oleg
Also pay attention that you use TestDB tablespace (Initial Catalog=TESTDB;)
Maybe you need to use another Database?

You can send SQL for creation of this table (with data) for investigation to my email (oleg (at) robotask.com).