Re: 1. DatePart in SQL= Select statement 2. Set first day of week

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Cheryl (Cheryl_at_discussions.microsoft.com)
Date: 11/22/04


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...
> > >
> >
> >
> >



Relevant Pages

  • Re: Cross Database Join, C++ program set up confusion
    ... Well what kind of data are you returning if it is not in Recordset? ... Recordset is returned (it is fractionally faster as ADO does not waste time ... If the default database is db1 on the ... It is a function of SQL Server. ...
    (microsoft.public.vc.database)
  • Re: Full-Text Results to MS Access
    ... Being new to SQL Server and ADO, ... (My database was started in pre-ADO days so the Access ... like a true/false flag, a value, etc., but if the result is a recordset, I ... based on some full-text search criteria. ...
    (microsoft.public.sqlserver.fulltext)
  • Re: type argument in OpenRecordset method
    ... For efficiency reasons you should always open the least-functional recordset ... Since you are using SQL Server linked tables, you have a choice of three: ... dbOpenSnapshot: recordset can't be updated, but you can navigate in it. ... Dim strExec As String ...
    (comp.databases.ms-access)
  • Re: Implementation of full text
    ... There is no documented way of accessing the MSSearch catalogs directly other ... tables in SQL Server to identify the row the hit occurs in. ... table to a client from an extended stored procedure. ... To use the recordset returned from the ESP as a virtual table>. ...
    (microsoft.public.sqlserver.fulltext)
  • Re: Upsizing issue
    ... >>> half the application because of stupid Recordset problem. ... You could link the SQL Server ... magnitude as modifying the original ASP pages. ...
    (microsoft.public.inetserver.asp.db)