10-21-2013 09:26 AM
I have OpsCenter 184.108.40.206 running on Windows Server 2003. I have the Analytics license and have been writing a custom SQL report with the help of the schema document supplied by Symantec.
I wonder if anyone could help me work out how to limit my report to data between two given dates? The example below runs but returns ALL dates in the Backup Time column, not just the dates in September that I require.
I found the syntax for 'between '01/Sep/13' and '30/Sep/13'' from some random Stack Overflow page so I could be barking up the wrong tree completely here... but I'm a backup admin not an SQL dev :)
Anyone got any hints?
SELECT domain_MasterServer.friendlyName as 'Master', domain_SLPImage.clientName as 'Client', domain_SLPImage.id as 'Backup ID', domain_SLPImage.policyName as 'Policy', UTCBigIntToNomTime(domain_SLPImage.writeStartTime) as 'Backup Time', UTCBigIntToNomTime(domain_SLPImage.slpCompletionTime) as 'Duplication Time' FROM domain_SLPImage,domain_MasterServer WHERE domain_MasterServer.id=domain_SLPImage.masterServerId AND UTCBigIntToNomTime(domain_SLPImage.writeStartTime) between '01/Sep/13' and '30/Sep/13' ORDER by domain_SLPImage.id;
10-23-2013 03:05 AM
AND UTCBigIntToNomTime(domain_SLPImage.writeStartTime) between '01/Sep/13' and '30/Sep/13'
AND UTCBigIntToNomTime(domain_SLPImage.writeStartTime) between 'Sept 1 2013' and 'Sept 30 2013'
10-23-2013 03:25 AM
Hi Sean, that does seem to work! May I ask how you knew the correct date format?
10-23-2013 04:28 AM
I believe that the format is the "normal" date format.
UTCBigIntToNomTime(domain_SLPImage.writeStartTime) as 'Backup Time',
Convert(varchar(20), UTCBigIntToNomTime(domain_SLPImage.writeStartTime),120) as 'Backup Time',
And the date will appear differently (yyyy-mm-dd hh:mm:ss)
If you change 120 to another number, a different format can be produced (check on a SQL website -some may not be available on OpsCenter, however).
10-24-2013 02:09 AM
Thanks - just what I needed! :)