Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
Daza
Starting Member
1 Post |
Posted - 2008-09-17 : 18:53:58
|
Hi There,The company I work for has recently purchased some Help Desk software which runs on a MySQL Database. Now, I would like to generate reports using Reporting Services 2005.The problem I am facing is that the date field (integar) within the MySQL DB is a set of numbers (E.g. 1220560003) – this set of numbers (seconds) is based on Unix Time (Epoch time), starting from 01 01 1970.I have managed to convert this time into a readable format using the SQL function DATEADD.Here is the query I am running:Select t1.Ticketid, Contents, t3.title as Module, t2.subject, t1.fullname as Staff, cast(dateadd(ss,-14440, Dateadd(ss,t1.dateline,'19700101') +1) as smalldatetime) AS LoggedDate, t5.Title as ClientFrom swtickets t1, swticketposts t2, swdepartments t3, swusergroups t5, swusers t6Where t1.ticketstatusid = @TicketStatusand t5.usergroupid = @Clientand (t1.dateline >= @StartDate) and (t1.dateline-1 <=@EndDate)and t1.ticketid = t2.ticketidand t2.userid = t6.useridand t6.usergroupid = t5.usergroupidand t3.departmentid = t1.departmentidand t2.dateline = (select min(dateline) from swticketposts t4where t4.ticketid = t2.ticketid)order by t2.dateline descThe LoggedDate field then displays as 2008-07-21 12:15:00Without the cast function it currently displays as 2008-07-21 12:15:13.000The problem I am facing is within Reporting Services for users to have the ability to select a date using the Calendar boxes the fields need to be datetime. When I setup the parameters within Reporting Services for @StartDate and @Enddate and make them datetime, the report fails to run – with the error:Arithmetic overflow error converting expression to data type datetimeSo I guess what I am asking is:Would anyone know what Parameter I could place in my Report for @StartDate and @EndDate to enable my report to work?I tried this, but it didn't seem to work - =DateTime.Parse(Parameters!StartDate.Value).ToString("dd MMM yyy")After researching on the net, the general consenus is to utilise the DateTime object which is part of .net to get my parameter to work.I have created multiple reports so far, but not based on any type of date range.Thanks, |
|
afrika
Master Smack Fu Yak Hacker
2706 Posts |
Posted - 2008-09-17 : 19:07:04
|
this site is for microsoft ms sql, try posting here sitepoint.com/forums or dbforums.com |
 |
|
|
|
|
|
|