I have table in Database which has only one date and I am process to write store procedure in which I want to indicate startdate and end date to show certain information between two dates. How can I do that?
What I am trying to do is between to Data A and Date B (Order date), how much sales I have done.
Thank you.
If I correct I need to find this by using Where clause by utilizing Startdate and end date as a parameter.
Thank you very much.
Query I have is as follow:
CREATE TABLE [dbo].[sales](
[stor_id] [char](4) NOT NULL,
[ord_num] [varchar](20) NOT NULL,
[ord_date] [datetime] NOT NULL,
[qty] [smallint] NOT NULL,
[payterms] [varchar](12) NOT NULL,
[title_id] [dbo].[tid] NOT NULL,
CONSTRAINT [UPKCL_sales] PRIMARY KEY CLUSTERED
(
[stor_id] ASC,
[ord_num] ASC,
[title_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]