Re: 1. DatePart in SQL= Select statement 2. Set first day of week
From: Cheryl (Cheryl_at_discussions.microsoft.com)
Date: 11/22/04
- Next message: Adam Machanic: "Re: Help with @@Rowcount"
- Previous message: John Shepherd: "Help with @@Rowcount"
- In reply to: Cheryl: "Re: 1. DatePart in SQL= Select statement 2. Set first day of week"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 22 Nov 2004 11:42:20 -0800
was having a duh moment... I guess... was on the right track all along.. just
forgot that the date that resulted was part of the recordset now... not stand
alone... Works fine now..
Thank you for your help!
"Cheryl" wrote:
> Thank you...
>
> However I did try something similar previously and as now... I get nothing
> in the drop down.... Showing... just an empty drop down....
>
> <select NAME="Year" SIZE="1">
> <% do while not objRecordset2.EOF %>
> <option ><%=WeekNo %></option>
> <% objRecordset2.MoveNext
> loop
> objRecordset2.Close
> objConn2.Close
> Set objRecordset2=Nothing
> Set objConn2=Nothing
> %>
> </Select>
>
>
> "Wayne Snyder" wrote:
>
> > > strSQL2 = "Select distinct(DatePart(ww,DateWorked)) AS WeekNo, DateWorked
> > FROM
> > > TimeSheets ORDER BY WeekNo ASC"
> >
> > To make the week start on Saturday you'll have to write a UDF probably , or
> > a more complicated query...
> >
> > --
> > Wayne Snyder, MCDBA, SQL Server MVP
> > Mariner, Charlotte, NC
> > www.mariner-usa.com
> > (Please respond only to the newsgroups.)
> >
> > I support the Professional Association of SQL Server (PASS) and it's
> > community of SQL Server professionals.
> > www.sqlpass.org
> >
> > "Cheryl" <Cheryl@discussions.microsoft.com> wrote in message
> > news:A5AE5D5B-4EA1-49F5-A32A-234533E01F49@microsoft.com...
> > > I am having a couple of problems that I would be grateful for assistance
> > with:
> > >
> > >
> > > 1. First of all,
> > >
> > > I am having trouble with my syntax when trying to retrieve the week number
> > > in Frontpage connection to SQL 2000 database.
> > >
> > > I can connect successfully.. and retrieve information using a straight
> > > forward approach...
> > >
> > > I want a drop down that consists of a distinct week number extracted from
> > > the Date called DateWorked so that a user can select Week 40 and see all
> > the
> > > work done for that week..
> > >
> > > strSQL2 = "Select DatePart(ww,DateWorked) AS WeekNo, DateWorked FROM
> > > TimeSheets ORDER BY WeekNo ASC"
> > >
> > > Second Problem:
> > >
> > > 2. I am not sure how to code it to make the first day of the work week a
> > > Saturday.. We run Saturday - Friday....
> > >
> > > This is going to be done from Frontpage 2003 and connecting to an sql 2000
> > > database.
> > >
> > > Thank you in advance for any direction you can give me...
> > >
> >
> >
> >
- Next message: Adam Machanic: "Re: Help with @@Rowcount"
- Previous message: John Shepherd: "Help with @@Rowcount"
- In reply to: Cheryl: "Re: 1. DatePart in SQL= Select statement 2. Set first day of week"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|