Re: datepart + dateadd
- From: "Sylvain Lafontaine" <sylvain aei ca (fill the blanks, no spam please)>
- Date: Fri, 31 Mar 2021 19:59:34 -0500
Looks good to me, I don't see the error.
Maybe replacing nchar(2) with nvarchar(2) and removing the trailing « , 0 »
at the end of the convert functions.
Whats happens if you remove the Between clause and move the cast function
from the Where to the Select statement?
--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: http://cerbermail.com/?QugbLEWINF
"JEM" <Jenn@xxxxxxxxxxxxxxxxx> wrote in message
news:1143841863.179260.93530@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Thanks. I'm still not doing something right. Here is what i have:
SELECT dbo.tblChild.FName, dbo.tblChild.LName,
dbo.tblChild.Birthday
FROM dbo.tblChild
WHERE
(CAST(CONVERT(nchar(2), DATEPART(month, dbo.tblChild.Birthday), 0) +
N'/' +
CONVERT(nchar(2), DATEPART(day, dbo.tblChild.Birthday), 0) + N'/' +
CONVERT(nchar(4), DATEPART(year, GETDATE()), 0) AS datetime)
BETWEEN DATEADD(d, 21, GETDATE()) AND DATEADD(d, 28, GETDATE()))
Any ideas? I keep getting an error message that says something about
arithmetic overflow.
.
- Follow-Ups:
- Re: datepart + dateadd
- From: Sylvain Lafontaine
- Re: datepart + dateadd
- References:
- Re: datepart + dateadd
- From: JEM
- Re: datepart + dateadd
- Prev by Date: Re: (CROSS POSTED) Very strange: Connection under process info not whats in front-end
- Next by Date: Re: datepart + dateadd
- Previous by thread: Re: datepart + dateadd
- Next by thread: Re: datepart + dateadd
- Index(es):
Relevant Pages
|