|
-
May 13th, 2003, 04:08 AM
#1
Thread Starter
Fanatic Member
VB to SQL
Hi All
I need to be able to chenge this
VB Code:
If TimeValue(Time) <= TimeValue(TimeSerial(mvarSessionStartTime, 0, 0)) Then
SessionDate = DateAdd("d", -1, Date)
Else
SessionDate = Date
End If
to a SQL equivilant in a stored procedure
Does anyone have any ideas. SQL doesn't seem to have the vb equivilant functions.
Thanks
Gary Lowe 
VB6 (Enterprise) SP5
ADO 2.6
SQL Server 7 SP3
OK I know my spelling and grammer is crap so don't quote me on it!
To err is human to take the P! is only natural !!
Click on the top section of image for Marcus Miller website and bottom section of image for 'Run For Cover' sound clip

-
May 13th, 2003, 12:20 PM
#2
Lively Member
Perhaps I'm missing something here, but would this work
IF GETDATE() <= @DateValue
@NewDate = DATEADD(d, -1, GETDATE())
ELSE
@NewDate = GETDATE()
END IF
Where @DateValue is a passed value and @NewDate is a variable declared in the stored procedure.
I think the following is possible, but I can't make it work unless converting the date to an integer)...
Instaed of @NewDate, you could just have the stored procedure return the value...
return DATEADD(d, -1, GETDATE())
I don't know how to post code as you did. How do you do that?
-
May 14th, 2003, 02:33 AM
#3
Thread Starter
Fanatic Member
Thanks Virgil
Gary Lowe 
VB6 (Enterprise) SP5
ADO 2.6
SQL Server 7 SP3
OK I know my spelling and grammer is crap so don't quote me on it!
To err is human to take the P! is only natural !!
Click on the top section of image for Marcus Miller website and bottom section of image for 'Run For Cover' sound clip

Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|