Hello,
I'm working on a Java DB application and I'm having a problem with this SQL statement when using the "Or","|", or "||" operators.
Here is my code:
Data1.setRecordSource("SELECT * FROM tblUnit WHERE (MACOM) OR (DIVISION + MACOM) OR (CORPS + MACOM) OR (INSTALLATION) OR (BRIGADE + DIVISION) OR (BATTALION + BRIGADE) OR (BATTALION + CORPS) OR (BATTALION + DIVISION) OR (BRIGADE + MACOM) OR (USACHAPLAINCY) = '" +
frmUnit.Login.userName.getText() + "'");
It works perfectly with:
Data1.setRecordSource("SELECT * FROM tblUnit WHERE (BRIGADE + DIVISION) = '" + frmUnit.Login.userName.getText() + "'");
I've tried "OR" first ans so then I tried the "|" (or) in Java and "||" (logical or) in Java. I thought it was my concatenation but figured out that my concatenation was ok when I tried one combonation without the "OR" operator.
Please help!
Eforce
I'm working on a Java DB application and I'm having a problem with this SQL statement when using the "Or","|", or "||" operators.
Here is my code:
Data1.setRecordSource("SELECT * FROM tblUnit WHERE (MACOM) OR (DIVISION + MACOM) OR (CORPS + MACOM) OR (INSTALLATION) OR (BRIGADE + DIVISION) OR (BATTALION + BRIGADE) OR (BATTALION + CORPS) OR (BATTALION + DIVISION) OR (BRIGADE + MACOM) OR (USACHAPLAINCY) = '" +
frmUnit.Login.userName.getText() + "'");
It works perfectly with:
Data1.setRecordSource("SELECT * FROM tblUnit WHERE (BRIGADE + DIVISION) = '" + frmUnit.Login.userName.getText() + "'");
I've tried "OR" first ans so then I tried the "|" (or) in Java and "||" (logical or) in Java. I thought it was my concatenation but figured out that my concatenation was ok when I tried one combonation without the "OR" operator.
Please help!
Eforce