Print Page | Close Window

SQL ISSUE.. PEEPS

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Database Discussion
Forum Description: Discussion and chat on database related topics.
URL: https://forums.webwiz.net/forum_posts.asp?TID=1865
Printed Date: 29 March 2026 at 8:07pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: SQL ISSUE.. PEEPS
Posted By: vaio
Subject: SQL ISSUE.. PEEPS
Date Posted: 17 April 2003 at 4:36am
INSERT INTO dbo.viewed (userID, staffID, the_date)
VALUES ('<%=Request.Servervariables ("LOGON_USER")%>', staffID, 'getdate()')
WHERE staffID = MMColParam


NAME DEFAULT NAME RUN-TIME-VALUE
MMColParam 1 Request.QueryString("staffID")

Does anyone know the correct SQL for it...

basically i am trying to store the user_domain_name and STAFFID (which is passed via a URL parameter into the dbo.viewd table

Any help please

thanking you in advance





Replies:
Posted By: Bunce
Date Posted: 17 April 2003 at 5:06pm

Dim iStaffID              'as integer
Dim strUser          'as string
Dim strSQL               'as string

iStaffID = request.querystring("StaffID")
strUser = Request.Servervariables ("LOGON_USER")

strSQL = "INSERT INTO dbo.viewed (userID, staffID) _
                 Values ('" & strUSer & "'," & iStaffID & ")"

Conn.Execute (strSQL)

You don't need to pass getdate(). Just set the default value of that column to GetDate(), and it will be added automatically when you insert the record. This is assuming that the database server holds the correct time.

If not pass it now(), which gets the current time, in ASP, from the web server.

Cheers,
Andrew



-------------
There have been many, many posts made throughout the world...
This was one of them.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net