Hi all - use the curdate() or current date to look at newly added awards in the last 3 months
The SQL table used to store the created date when an award was added is tbl_net_centre.reg_date and keeps throwing up an error on the <= If anyone can advise the correct syntax for this.
-- New Networks by date less than 3 months--
select
tbl_centre.centre_id,
tbl_centre.centre_no,
tbl_centre.centre_name,
tbl_region.region,
tbl_net.network_code,
tbl_centre.reg_date,
tbl_net_centre.reg_date,
count(tbl_centre.reg_date) as Nunmber_of_New_networks
FROM
tbl_centre
LEFT JOIN
tbl_net_centre ON tbl_centre.reg_date = tbl_net_centre.reg_date
LEFT JOIN
tbl_net_centre ON tbl_centre.centre_id = tbl_net_centre.centre_id
LEFT JOIN
tbl_net ON tbl_net_centre.ntwrk_cd = tbl_net.network_code
LEFT JOIN
tbl_region ON tbl_centre.region_code = tbl_region.region_ID
WHERE
tbl_centre.reg_status = 'R'
AND tbl_net_centre.net_reg_stts in ('R' , 'P')
AND tbl_region.region_ID = '3'
AND 'tbl_net_centre.reg-date' <=(CURDATE(), INTERVAL 3 MONTH)
group by tbl_centre.centre_id
having Nunmber_of_New_networks =1 AND network_code='E'
limit 1000;
Thanks in advance
D