I'm working in a C# program. I'm using Access 2010. I have some SQL Queries which are confusing.
OleDbCommand cmd = new OleDbCommand("SELECT * FROM Daybook WHERE [Entry Date]<=#" +
dateTimePicker13.Value.ToString("yyyy/MM/dd", CultureInfo.InvariantCulture) +
"# AND [Entry Date]>=#" +
dateTimePicker12.Value.ToString("yyyy/MM/dd", CultureInfo.InvariantCulture) +
"# AND Credit<>0 AND Debit<>0", conn);
It is not working. I have also tried with NOT Credit=0
... But that is also not working. When I tried `Credit!=0' it gave me a syntax error.
Also : When I replace 0 with 1, NOT Credit=1
Or Credit<>1
it responses back and shows all values other than 1, which is correct for the second case.
Is this the correct method to do this? I have to select values where Credit and Debit are not 0. Is there a possible alternate or is that a syntax mistake I made?
Thanks in Advance!