Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 17th, 2004, 12:03 PM
Registered User
 
Join Date: Jun 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default [ReportingService] DateTime function errors

hi everyone,

I'm trying to find a difference between a datetime field and the current date.
In the textBox i write the following:
   =datediff(day, Fields!date.Value, Globals!ExecutionTime)

Errors:
textbox 'date': Argument 'Interval' is not a valid value
textbox 'date': Argument not specified for the dateValue of Public Function Day(DateValue as Date)

Can you help?
Thanks

 
Old June 17th, 2004, 01:23 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

=datediff(day, Fields!date.Value, Globals!ExecutionTime)

The day in the above datediff function is a function itself, where it has to be an interval parameter.

You can check the help on datediff function for its syntax and parameters.

Actually the first paramaeter to datediff function should be any of this.

Syntax
DATEDIFF(datepart, startdate, enddate)

Arguments
datepart

Is the parameter that specifies on which part of the date to calculate the difference. The table lists dateparts and abbreviations recognized by Microsoft® SQL Server™.

Datepart Abbreviations
year yy, yyyy
quarter qq, q
month mm, m
dayofyear dy, y
day dd, d
week wk, ww
hour hh
minute mi, n
second ss, s
millisecond ms

In your case you should use dd or d
Hope that helps.
Cheers!

_________________________
-Vijay G
Strive for Perfection
 
Old June 17th, 2004, 01:36 PM
Registered User
 
Join Date: Jun 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I still got error saying 'dd' is not declared.... sad sad!
The functions given in the WROX text book don't work at all.... humm.... i wonder why

I ended up using the following function:

=DateDiff(dateInterval.month, Fields!date.Value,date.today())

thanks~





Similar Threads
Thread Thread Starter Forum Replies Last Post
No Render Webmethod in ReportingService webservice recook2 Reporting Services 0 April 12th, 2007 03:38 PM
function adjust-dateTime-to-timezone Tomi XSLT 3 July 26th, 2006 11:51 AM
datetime function Adam H-W Classic ASP Basics 5 July 23rd, 2005 02:24 AM
UTC DateTime to Local DateTime r_ganesh76 SQL Server 2000 1 April 4th, 2005 08:21 AM
ReportingService.Render Method jmurdock BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 0 July 23rd, 2004 02:58 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.