cancel
Showing results for 
Search instead for 
Did you mean: 
Subscribe

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:

http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.help.ase_15.0.blocks/html/blocks/block...

View Entire Topic
Breck_Carter
Participant

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.