I'm using
SELECT EXTRACT(WEEK FROM trans_date), SUM(tran_amount) ... GROUP BY
trans_date
and it is being used to group sales results by week. It works really well.
What I'm wondering is if I can shift the week from a Mon-Sun
articulation(default with Postgre) to a Sun-Sat sequence. I need it
Hi,
I am using the crosstab function by Joe Conway and I am having a problem
that could be my fault but I'm not sure.
My query/result is:
atc=# SELECT * FROM crosstab('SELECT cli_tran_trans_date,
TRIM(dat_staff_code) AS dat_staff_code, SUM(cli_tran_amount) from vetpmardet
WHERE cli_tran_trans_da
I'm still trying to isolate issues with my SELECT query. I have a table in
my veterinary software which stores my sales transactions. The pertinent
columns are dat_staff_code (stores the doctor who gets credit for the sale),
sys_tran_number (stores a unique transaction #), cli_credit_adj_trans_no
(
I
have a SELECT query that basically adds up my sales, removes credit adjustments
(eg. Returns) and gives the net figure.
This
is the query:
SELECT
(SELECT SUM(cli_tran_amount) FROM vetpmardet WHERE cli_credit_adj_trans_no IN
(SELECT sys_tran_number from vetpmardet WHERE cli_tran_trans