Topic: any idea for count queries
i have this query
if SQLExecute("SELECT COUNT(*) FROM student WHERE date = '" + student.DateTimePicker1.sqlDate + "' AND id_Teachers = CAST('" + student.ComboBox1.sqlValue + "' AS INTEGER)") <> 0 then
here I want to check the date if this date is already available for specific teacher for that I used
id_Teachers = CAST('" + student.ComboBox1.sqlValue + "' AS INTEGER)"
to check only if the date is available for that teacher (id_Teachers) and this is a forging key , but the code is not working ! any idea please …
I have changed the student.ComboBox1.sqlValue to integer as I see that it is a string .