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.
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.
You are absolutely correct about VBScript casting the date to an integer before it does the modulus. And Zeroeth day of the month is a bizarre idea.
I can see how taking the last day of the previous month and adding 7 times the Nth (1 for the first whatever day, 2 for the second, etc.) gets...
I'm trying to write a T-SQL function that can find the third Tuesday, or the fourth Saturday, or the second Wednesday of every month. I found a VBScript version of something similar at http://www.merlyn.demon.co.uk/vb-dates.htm#ILS. VBScript and T-SQL don't do dates exactly the same way. I'm...
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...
One way to make a Stored Procedure accept optional variables is by assigning default values to them when they are not passed. Something like:
CREATE PROCEDURE usp_Whatever
@EmployeeID smallint,
@FirstName nvarchar(25) = NULL,
@LastName nvarchar(25) = NULL
AS
IF @FirstName <> NULL
BEGIN...
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...
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...
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.
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.
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?
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...
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...
I understand now what hneal98 meant when he said "Have you tried a data cube?" 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...
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...
Thanks James. That's just what I needed. I've never used the ordinal references to column names before, because I've always known the column names. That's cool. I'll probably use that again pretty soon.
I have bad news. I got an error message that says: "Current provider does not support...
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...
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...
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?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.