admin 7/21/2017 | |
You need to troubleshoot your code. I.e. instead of executing the query print it on the page, run it manually and see it it returns correct data. The same thing with UPDATE SQL query. Print, test manually, see if it works. |
H
|
Hertz2P author 7/21/2017 |
Thanks Sergey, can you give a quick example of how that's done? Searching for 'print' is pulling up a lot of printer related issues.. |
H
|
Hertz2P author 7/21/2017 |
Okay, I've figured out that the sql is the part that's not working. I think it may be due to the fact that the field I would like the totals from is a calculated field (uses startTime and endTime to calculate hoursWorked). However, using the totals page to get the totals works. So I guess my question is can the DAL access the totals field of a details table directly?
|
admin 7/21/2017 | |
Instead of hoursWorked you need to use the same expression in your custom query: $rs = CustomQuery("select sum(round(time_to_sec(timediff(endTime,startTime))/ 3600,2)) from timeClock where timeCardId=".$_SESSION[$strTableName."_masterkey1"]); |
H
|
Hertz2P author 7/21/2017 |
Thanks Sergey, that works great! |
admin 7/21/2017 | |
Yes, you can do redirect in your event code after running this update. |
H
|
Hertz2P author 7/21/2017 |
Yes, you can do redirect in your event code after running this update.
|
H
|
Hertz2P author 7/22/2017 |
If I add the redirect code under the (working) above code, it throws an error and doesn't redirect... In other words, either piece of code works on its own, but if I put the redirect under the DAL code it's no good.
|