Ashok wrote:
I have 2 cells with date and time in a table.
Why? You should have ONE field of DATEIME type.
I have to check if the combination of given date & time exists
in the table before a new record is inserted.
You absolutely don't have to check it. Create a unique
index on the DATETIME field suggested above (or, if you
insist on keeping your awkward two-field combination,
a single index on both date and time fields). Then you
can INSERT all you want, no duplicates will be allowed;
include the IGNORE keyword, if you want to suppress error
messages.
Cheers,
NC