• HI There,

    Sorry about the low brow post it's been a long week. I have attached some sample data and table structures. Basically what i'm trying to do is return a list of store hours that exist in the database that are no more than 7 days from today inclusive.I need to pass the storename in a parameter.

    Sean - thanks in advance

    !--- table

    SET ANSI_NULLS ON

    GO

    SET QUOTED_IDENTIFIER ON

    GO

    SET ANSI_PADDING ON

    GO

    CREATE TABLE [tblhours](

    [StoreID] [int] NULL,

    [StoreDate] [datetime] NULL,

    [OpenTime] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,

    [ClosingTime] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,

    [Comments] [varchar](250) COLLATE SQL_Latin1_General_CP1_CI_AS NULL

    ) ON [PRIMARY]

    GO

    SET ANSI_PADDING OFF

    !---- sample data

    49022008-11-25 00:00:00.00010:00a5:30pcomments

    49022008-11-26 00:00:00.00010:00a5:30pcomments

    49022008-11-27 00:00:00.00010:00a5:30pcomments

    49022008-11-28 00:00:00.00010:00a5:30pcomments

    49032008-11-25 00:00:00.00010:00a5:30pcomments

    49032008-11-26 00:00:00.00010:00a5:30pcomments

    49032008-11-27 00:00:00.00010:00a5:30pcomments

    49032008-11-28 00:00:00.00010:00a5:30pcomments

    !------------------------- table

    SET ANSI_NULLS ON

    GO

    SET QUOTED_IDENTIFIER ON

    GO

    SET ANSI_PADDING ON

    GO

    CREATE TABLE [stores](

    [StoreID] [int] NOT NULL,

    [StoreName] [varchar](200) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,

    CONSTRAINT [PK_stores] PRIMARY KEY CLUSTERED

    (

    [StoreID] ASC

    )WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]

    ) ON [PRIMARY]

    GO

    SET ANSI_PADDING OFF

    !--------------------------------- sample data

    4903storeone

    4903storetwo