Link to home
Start Free TrialLog in
Avatar of Paul Pingel
Paul PingelFlag for United States of America

asked on

Where conditions ignoring parenthesis during execution.

SQL 2016 Where statement seems to be ignoring parenthesis,  I am trying to capture work transactions for for a day that has three shifts.  The day starts on 02/14 at 6:00 am and ends at the end of third shift on 2/15 at 6:00 am.  The database does not use datetime but rather has it broken into two separate fields.  When I execute it I get no results.  If I take out the time portion of the selection, I get all of the transactions for both days.  Any suggestions?  Here is the statement:

where ((date_work_trx >= '2018-02-14' and time_work_trx > 060000) and (date_work_trx <= '2018-02-15' and time_work_trx <= 060000))
SOLUTION
Avatar of Qlemo
Qlemo
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Paul Pingel

ASKER

Thank you for your help.