Hi there.
Been scatching my head for a bit with this now, and cant find an easy solution, or pretty much any solution..
Im moving from MSSQL - Postgresql. the query in MSSQL was:
SELECT Now()-([DateOrdered])-1.2 AS Expr1 .....
and
WHERE ((Now()-([DateOrdered])-1.2)>6) ...
so the basic idea is work out if dateordered > 6 days, but take away the 2 non-working days weekends.
So i need to do:
WHERE NOW() - dateordered(APART FROM SAT SUN) > 6.. but dont know how to do it.
I can find the day of a certain date using SELECT extract(dow from dateordered); which will give me 1-6 0 being sunday, 1 being monday for example.
Any ideas how I can put all this together though?
I could use php if it cant be done just in a query.
Cheers
Been scatching my head for a bit with this now, and cant find an easy solution, or pretty much any solution..
Im moving from MSSQL - Postgresql. the query in MSSQL was:
SELECT Now()-([DateOrdered])-1.2 AS Expr1 .....
and
WHERE ((Now()-([DateOrdered])-1.2)>6) ...
so the basic idea is work out if dateordered > 6 days, but take away the 2 non-working days weekends.
So i need to do:
WHERE NOW() - dateordered(APART FROM SAT SUN) > 6.. but dont know how to do it.
I can find the day of a certain date using SELECT extract(dow from dateordered); which will give me 1-6 0 being sunday, 1 being monday for example.
Any ideas how I can put all this together though?
I could use php if it cant be done just in a query.
Cheers