RE: datetime calculation
From: p (p_at_discussions.microsoft.com)
Date: 02/04/05
- Next message: Lennon King: "The default 'TRUE' does not exist."
- Previous message: seeker53: "Re: datetime calculation"
- In reply to: seeker53: "datetime calculation"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 4 Feb 2005 12:39:01 -0800
Used Northwind DB as an example:
Declare @OrderDate datetime
Set @OrderDate = '7/4/1996'
Select p.ProductName, o.OrderDate
>From Products p
Inner Join [Order Details] od On p.ProductID = od.ProductID
Inner Join Orders o On od.OrderID = o.OrderID
--Where o.OrderDate = '7/4/1996'
Where o.OrderDate = DateAdd(dd, 1, @OrderDate)
"seeker53" wrote:
> I have a datetime field in a SQL SERVER and I need to know clients that are
> scheduled for the next day when reading the info on the current day. I have
> tried
>
> [tblevent].[begin_datetime] = dateadd(d,1,getdate())
>
> within the where clause and this does not return any records. I know that
> the records exist because when I run [tblevent].[begin_datetime] = '2/5/05'
> many records return. I have also tried
>
> [tblevent].[begin_datetime] = getdate() + 1
>
> which also returns no records. How is the best way to solve this problem.
- Next message: Lennon King: "The default 'TRUE' does not exist."
- Previous message: seeker53: "Re: datetime calculation"
- In reply to: seeker53: "datetime calculation"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|