I'm trying to create an IF statement but I can't get it to work in SQL Anywhere 9. Here is the SQL:
select MICROS.time_card_dtl.emp_seq, MICROS.time_card_dtl.clk_in_date_tm, MICROS.time_card_dtl.clk_out_date_tm, MICROS.time_card_dtl.reg_hrs, MICROS.time_card_dtl.job_seq, jd.name, if hour(MICROS.time_card_dtl.clk_in_date_tm) < 5 then dateadd(day, -1, (date(MICROS.time_card_dtl.clk_in_date_tm))) else date(MICROS.time_card_dtl.clk_in_date_tm) end if from MICROS.time_card_dtl inner join micros.job_def jd on jd.job_seq = MICROS.time_card_dtl.job_seq where MICROS.time_card_dtl.clk_in_date_tm between '2013-05-10 00:07:00' and '2013-05-13 04:00:00' group by MICROS.time_card_dtl.emp_seq, MICROS.time_card_dtl.clk_in_date_tm, MICROS.time_card_dtl.clk_out_date_tm, MICROS.time_card_dtl.reg_hrs, MICROS.time_card_dtl.job_seq, jd.name order by MICROS.time_card_dtl.emp_seq
I don’t know SQL Anywhere very well, but I am very familiar with MySQL. We don’t have the SQL Anywhere 9 manual, and I’ve been trying to get by with the SQL Anywhere 10 manual found here:
Request clarification before answering.
Raphael, if you send me an email at breck dot [email protected] I will send you the Help files for V9.
Plus, you can buy my book, it's on V9.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.