SQl Display Query
Posted on 2012-03-29
I have been tasked with the following, We have alot of visitors visiting our company and the company would like some for of Welcome to display on a screen in reception, so what i am doing is collecting data from our CRM software which i will then display onto the monitor.
The query looks like this at the moment
SELECT dbo.dmactiv.startdate, dbo.dmactiv.starttime, dbo.dmactiv.duration, dbo.dmcont.firstname, dbo.dmcont.lastname, dbo.dmcont.comp_name
FROM dbo.dmactiv INNER JOIN
dbo.dmcont ON dbo.dmactiv.contid = dbo.dmcont.contid
and this output something along the lines of this
Startdate StartTime Duration Firstname LastName Comp_Name
2012-04-18 780 60 joe bloggs microsoft
so i deally what i would like to do is half an hour before the arrival the query returns only those that are visiting and once the duration has ended then they no longer are part of the query.
However as you can see from the above data the start Time and duration are produced as whole numbers and i am not sure how to acheive this
Can anybody help
Ps sorry for not posting the code properly but all the body functions always seem to be greyed out and i can never add anything not sure why :(