Hi
I have a table that look like this..
USE [TestDB]
GO
/****** Object: Table [dbo].[OrderStatus] Script Date: 2015-04-10 10:01:20 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[OrderStatus](
[ID] [int] IDENTITY(1,1) NOT NULL,
[OrderID] [int] NULL,
[OrderName] [nvarchar](50) NULL,
[OrderStatusInfo] [nvarchar](4000) NULL,
[Customer] [nvarchar](255) NULL,
[SiteID] [int] NULL,
[ProviderID] [int] NULL,
[Delivered] [bit] NULL,
[DateDelivered] [datetime] NULL,
[OrderDate] [datetime] NULL,
CONSTRAINT [PK_Order] PRIMARY KEY CLUSTERED
(
[ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
I need to select all rows that meet the following requirement..
All rows that have "Delivered" as NULL or FALSE or
rows that have "Delivered" = TRUE AND "DateDelivered" is more than 2 Days ago.
Can anyone help me with that?