when i put this in a text box, i get this error message:
="Includes Date:" & DatePart(""d"", Now() )
BC30518 Overload resolution failed because no accessible 'DatePart' can be
called with these argumentsdatepart is an SQL Server function, not a Reporting services function.
try this:
now().ToString("d")
write your RS function as VB.Net functions.
"Cindy Lee" <cindylee@.hotmail.com> a écrit dans le message de
news:O4KxH7%23gEHA.3988@.tk2msftngp13.phx.gbl...
> when i put this in a text box, i get this error message:
> ="Includes Date:" & DatePart(""d"", Now() )
>
> BC30518 Overload resolution failed because no accessible 'DatePart' can be
> called with these arguments
>
>|||SQL Server Reporting Services 2000 supports a large number of VB .NET
functions including the date manipulation ones.
Included in this set a DatePart() function. Pleaser refer to MSDN for more
information.
--
Bruce Johnson [MSFT]
Microsoft SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"Jéjé" <willgart@.BBBhotmailAAA.com> wrote in message
news:ub$Jif$gEHA.1972@.TK2MSFTNGP09.phx.gbl...
> datepart is an SQL Server function, not a Reporting services function.
> try this:
> now().ToString("d")
> write your RS function as VB.Net functions.
> "Cindy Lee" <cindylee@.hotmail.com> a écrit dans le message de
> news:O4KxH7%23gEHA.3988@.tk2msftngp13.phx.gbl...
> > when i put this in a text box, i get this error message:
> >
> > ="Includes Date:" & DatePart(""d"", Now() )
> >
> >
> >
> > BC30518 Overload resolution failed because no accessible 'DatePart' can
be
> > called with these arguments
> >
> >
> >
>
Showing posts with label includes. Show all posts
Showing posts with label includes. Show all posts
Friday, February 24, 2012
Tuesday, February 14, 2012
DateAdd
Hello Everyone,
I trying to build an SQL statement that includes the last twelve
months in the report. When I use the DATEADD function ie >= DATEADD(MM, - 12, GETDATE())) the report brings back data 12 months
from the current date. I would like to include the whole month not
just the current date. I hope this make sense!
R/ A. AkinHello awakin,
You need to take of the day of the month as well day(getdate()) returns the
day of the month but the simplest is to build the date from scratch i.e
convert(datetime, cast((year(getdate())-1) *100 + month(getdate())as char(6))
+ '01' ,112)
This builds a date string in the ISO format yyyymmdd and then converts it
to a date using the relevant coversion style for the ISO format
Simon Sabin
SQL Server MVP
http://sqlblogcasts.com/blogs/simons
> Hello Everyone,
> I trying to build an SQL statement that includes the last twelve
> months in the report. When I use the DATEADD function ie >=> DATEADD(MM, - 12, GETDATE())) the report brings back data 12 months
> from the current date. I would like to include the whole month not
> just the current date. I hope this make sense!
> R/ A. Akin
>|||On Sep 30, 3:47 am, Simon Sabin <SimonSa...@.noemail.noemail> wrote:
> Hello awakin,
> You need to take of the day of the month as well day(getdate()) returns the
> day of the month but the simplest is to build the date from scratch i.e
> convert(datetime, cast((year(getdate())-1) *100 + month(getdate())as char(6))
> + '01' ,112)
> This builds a date string in the ISO format yyyymmdd and then converts it
> to a date using the relevant coversion style for the ISO format
> Simon Sabin
> SQL Server MVPhttp://sqlblogcasts.com/blogs/simons
>
> > Hello Everyone,
> > I trying to build an SQL statement that includes the last twelve
> > months in the report. When I use the DATEADD function ie >=> > DATEADD(MM, - 12, GETDATE())) the report brings back data 12 months
> > from the current date. I would like to include the whole month not
> > just the current date. I hope this make sense!
> > R/ A. Akin- Hide quoted text -
> - Show quoted text -
Simon,
Thanks for the response; here is what worked for me.
>= DATEADD(MM, - 12, CAST(CAST(YEAR(GETDATE()) AS VARCHAR) + ' - ' +
CAST(MONTH(GETDATE()) AS VARCHAR) + '-01' AS DATETIME)))
This allowed me to return the appropriate data.
r/ A.Akin
I trying to build an SQL statement that includes the last twelve
months in the report. When I use the DATEADD function ie >= DATEADD(MM, - 12, GETDATE())) the report brings back data 12 months
from the current date. I would like to include the whole month not
just the current date. I hope this make sense!
R/ A. AkinHello awakin,
You need to take of the day of the month as well day(getdate()) returns the
day of the month but the simplest is to build the date from scratch i.e
convert(datetime, cast((year(getdate())-1) *100 + month(getdate())as char(6))
+ '01' ,112)
This builds a date string in the ISO format yyyymmdd and then converts it
to a date using the relevant coversion style for the ISO format
Simon Sabin
SQL Server MVP
http://sqlblogcasts.com/blogs/simons
> Hello Everyone,
> I trying to build an SQL statement that includes the last twelve
> months in the report. When I use the DATEADD function ie >=> DATEADD(MM, - 12, GETDATE())) the report brings back data 12 months
> from the current date. I would like to include the whole month not
> just the current date. I hope this make sense!
> R/ A. Akin
>|||On Sep 30, 3:47 am, Simon Sabin <SimonSa...@.noemail.noemail> wrote:
> Hello awakin,
> You need to take of the day of the month as well day(getdate()) returns the
> day of the month but the simplest is to build the date from scratch i.e
> convert(datetime, cast((year(getdate())-1) *100 + month(getdate())as char(6))
> + '01' ,112)
> This builds a date string in the ISO format yyyymmdd and then converts it
> to a date using the relevant coversion style for the ISO format
> Simon Sabin
> SQL Server MVPhttp://sqlblogcasts.com/blogs/simons
>
> > Hello Everyone,
> > I trying to build an SQL statement that includes the last twelve
> > months in the report. When I use the DATEADD function ie >=> > DATEADD(MM, - 12, GETDATE())) the report brings back data 12 months
> > from the current date. I would like to include the whole month not
> > just the current date. I hope this make sense!
> > R/ A. Akin- Hide quoted text -
> - Show quoted text -
Simon,
Thanks for the response; here is what worked for me.
>= DATEADD(MM, - 12, CAST(CAST(YEAR(GETDATE()) AS VARCHAR) + ' - ' +
CAST(MONTH(GETDATE()) AS VARCHAR) + '-01' AS DATETIME)))
This allowed me to return the appropriate data.
r/ A.Akin
Subscribe to:
Posts (Atom)