Does anyone know how to print the output of an SQL Query once it has been executed in SQL Server?
select count(eo.equal_opps_id) as 'Age 40 - 49'
from dbo.app_equal_opps eo, dbo.app_status s
where eo.date_of_birth > DateAdd(yy,-49,getDate())
and eo.date_of_birth < DateAdd(yy,-39,getDate())
and eo.application_id = s.status_id
and s.job_reference_number = '33211016'
and s.submitted = 1
Above shows an SQL query, however, once it is executed I would like to see the actual date values that are created at the following sections
DateAdd(yy,-49,getDate())
DateAdd(yy,-39,getDate())
In other words, once the query is executed, can I print the SQL Query output so that it shows something like this
select count(eo.equal_opps_id) as 'Age 40 - 49'
from dbo.app_equal_opps eo, dbo.app_status s
where eo.date_of_birth > '1962-05-04 13:00:00.000'
and eo.date_of_birth < '1972-05-04 13:00:00.000'
and eo.application_id = s.status_id
and s.job_reference_number = '33211016'
and s.submitted = 1
As always, any feedback would be greatly appreciated.
Thanks Everyone.