VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Convert TimeStamp To String

by Thomas Robbins (1 Submission)
Category: Databases/Data Access/DAO/ADO
Compatability: Visual Basic 3.0
Difficulty: Unknown Difficulty
Date Added: Wed 3rd February 2021
Rating: (4 Votes)

Converts the timestamp data type of SQL server into a string that is then suitable for use in a where clause

Rate Convert TimeStamp To String

Public Function CvtTimeStamp(TimeSt As String) As String
' This function will recieve the eight byte string of binary data
' returned as the value of a timestamp column and convert it into
' as string in the format 0x000000000000000 suitable for the use in an sql statement
' where clause
Dim HexValue As String
Dim K As Integer
For K = 1 To 8
    HexValue = HexValue & Right$("00" & Hex(AscB(MidB(TimeSt, K, 1))), 2)
Next K
CvtTimeStamp = "0x" & HexValue
  
End Function

Download this snippet    Add to My Saved Code

Convert TimeStamp To String Comments

No comments have been posted about Convert TimeStamp To String. Why not be the first to post a comment about Convert TimeStamp To String.

Post your comment

Subject:
Message:
0/1000 characters