Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. ClaytonQ

    Function to find the Nth Xday of each month between two dates

    Works every time, vongrunt. This is awesome. *skipping unashamedly around desk*[smile]
  2. ClaytonQ

    Function to find the Nth Xday of each month between two dates

    vongrunt, this is a huge leap forward. It's right most of the time. When you run it looking for the third Tuesday like this, it returns a correct answer UNLESS there is a Tuesday in the first week of the month. When that happens, this code returns the fourth Tuesday. This is really close. Thanks.
  3. ClaytonQ

    Function to find the Nth Xday of each month between two dates

    This link is closer to the correct part of the long page I got the original formula from: http://www.merlyn.demon.co.uk/vb-dates.htm#NXFM You have to view source to see the vbscript he wrote. The page exists to teach people how to do this stuff, so I'm certain he wants people to use his ideas.
  4. ClaytonQ

    Function to find the Nth Xday of each month between two dates

    ...in to SQL (as far as I can tell). To translate all the arithmetic into DateAdd and DateDiff, I came up with this: SET @TempDate = DateAdd(day,(7 * @Nth) - (DateDiff(day,DateAdd(day,-@Xday,@ZeroethDayOfMonth),@ZeroethDayOfMonth) % 7),@ZeroethDayOfMonth) I asked it to show me the third...
  5. ClaytonQ

    Function to find the Nth Xday of each month between two dates

    ...Xday of @TempMonth. Make that the new @TempDate. --From http://www.merlyn.demon.co.uk/vb-dates.htm#ILS SET @TempDate = @ZeroethDayOfMonth + (7 * @Nth) - ((@ZeroethDayOfMonth - @Xday) % 7) --Is @TempDate between @StartDate and @EndDate? If @TempDate BETWEEN @StartDate AND @EndDate --If...
  6. ClaytonQ

    IF Statement in WHERE Clause

    Found it! Maybe you can glean something useful from this. Names have been changed to protect the innocent: CREATE PROCEDURE usp_MailingEntries @Date nvarchar(20) = '%', @First nvarchar(20) = '%', @Last nvarchar(25) = '%' AS SELECT PersonID, FirstName, LastName, Address1, City, StateAbbrev, Zip...
  7. ClaytonQ

    IF Statement in WHERE Clause

    ...usp_Whatever @EmployeeID smallint, @FirstName nvarchar(25) = NULL, @LastName nvarchar(25) = NULL AS IF @FirstName <> NULL BEGIN SELECT * FROM Employees a INNER JOIN Departments b ON a.DepartmentID = b.ID WHERE a.EmployeeID = @EmployeeID AND a.FirstName = @FirstName END...
  8. ClaytonQ

    Formal Relationship between 4 tables

    I have a situation where I have three tables (InternalEvents, ExternalEvents, Classes) that each need access to a RoomReservations table. Each event or class may reserve multiple rooms, so each of those is on the one side of a one-to-zero-or-many relationship with RoomReservations. The...
  9. ClaytonQ

    Is it possible to disable a user's &quot;Tab&quot; key with ASP?

    I bet "SE" means "Search Engine." Search Engines will see the link and follow it, and index the contents of your "secret" page, and display them to anyone who asks. Also, if the Tab key is disabled, not a single blind or handicapped person will be able to visit your site. This would hurt you...
  10. ClaytonQ

    How to print in ASP, VBScript?

    You can get a long way by writing a style sheet specifically for print. You can pick font sizes and column widths and background colors for print independently of the screen. A great book is "Eric Meyer on CSS.
  11. ClaytonQ

    Help me make list of groups a user belongs to

    WOO HOO!!! Thank you thank you thank you. It has correctly listed every group I'm in. :) Yee-haw. *Victory dance* I am running this as ASP code. Is that why LDAP wasn't working? Thanks again. I can be productive again now that I'm past this barrier.
  12. ClaytonQ

    Help me make list of groups a user belongs to

    The first line of the script triggers this error on my server: Microsoft VBScript runtime error '800a01a8' Object required: 'Wscript' //global.asa, line 134 Wierd, isn't it?
  13. ClaytonQ

    Help me make list of groups a user belongs to

    Thanks mrmovie. I wasn't really dependant on the OU, it's just that that was the only piece of information I've been able to get so far, because everything else gave me an error. It was progress, but not progress in a straight line toward my goal. I tried the code, and got an error: Microsoft...
  14. ClaytonQ

    Help me make list of groups a user belongs to

    Hi everyone. I am in the midst of moving our Intranet system from Windows NT to Windows 2000. (I know, I know.) I am a web programmer, not a network admin. Our old Windows NT Intranet was relying on a dll called NTUtils to get a list of groups. On the new system, I want to use the abilities...
  15. ClaytonQ

    Return a recordset and count of the rows with 1 sp?

    I understand now what hneal98 meant when he said &quot;Have you tried a data cube?&quot; Something like: Select Count(*), FirstName FROM Employees GROUP BY FirstName WITH CUBE returns a recordset with the Count in the last row of the recordset. I could have ran a stored procedure like that...
  16. ClaytonQ

    Return a recordset and count of the rows with 1 sp?

    I found out what the code above was missing. As it turns out, you can't read an output variable with ASP 3.0 until after you close the recordset. Wierd, eh? The reason I wanted the record count returned with the recordset was so that I could dim my vbscript array with the proper number of...
  17. ClaytonQ

    Return a recordset and count of the rows with 1 sp?

    ...I've got so far: CREATE PROCEDURE usp_GetInterests @PersonID int, @InterestCount int = Null OUTPUT AS SELECT @InterestCount = CAST((SELECT COUNT(*) FROM tblInterests WHERE (intID = @PersonID)) AS int) SELECT intID, intInterestsID FROM tblInterests WHERE (intID = @PersonID) This seems to...
  18. ClaytonQ

    Return a recordset and count of the rows with 1 sp?

    That's awesome Sunil. I just read about SET NOCOUNT in Books On-Line, and I read about the NextRecordset method at MSDN. Now, if I use Set recordset2 = recordset1.NextRecordset( RecordsAffected ) then recordset2 will automatically contain the count. But to get the value out of the recordset, I...
  19. ClaytonQ

    Return a recordset and count of the rows with 1 sp?

    I am reading the SP from VB. ASP 3.0 using vbScript. I can get the record count from the ado.recordset. But to do that, I'll need a static cursor, and to get a static cursor I'll have to create my recordset explicitly instead of letting it be created implicitly by an ado.command object. The...
  20. ClaytonQ

    Return a recordset and count of the rows with 1 sp?

    I notice when I run an sp in Query Analyzer that returns a recordset, it automatically says how many rows were affected after it displays the recordset. If that information is also returned somehow when the sp is called from ADO, that's all I'd need, right? Does it do that?

Part and Inventory Search

Back
Top