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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search on timestamp

Status
Not open for further replies.

mts176

MIS
Apr 17, 2001
109
US
Is there a way to search on timestamps?
I have been trying but I keep getting a "Type mismatch error"

Any help is appreciated
 
No. Timestamp is NOT a date and time.

From the BOL:

timestamp is a data type that exposes automatically generated binary numbers, which are guaranteed to be unique within a database. timestamp is used typically as a mechanism for version-stamping table rows. The storage size is 8 bytes.

Remarks
The Transact-SQL timestamp data type is not the same as the timestamp data type defined in the SQL-92 standard. The SQL-92 timestamp data type is equivalent to the Transact-SQL datetime data type.

-SQLBill

BOL=Books OnLine=Microsoft SQL Server's HELP
Installed as part of the Client Tools
Found at Start>Programs>Microsoft SQL Server>Books OnLine

Posting advice: FAQ481-4875
 
Thanks for the insight SQLBill.
I have also been trying to get all of the rows out of a table for a specific ID. When I take this query and run it through analyzer it runs fine, but when I try to run it through ASP via a Do while not rs.eof Loop it runs until the page times out.

This isn't a query run in SQL Server. It is run through an ODBC query analyzer. The ODBC that I am using is AcuODBC, I am getting data out of an accounting package called Sirius.

Does anybody have any information on AcuODBC or sirius?
 
What are you doing in the while loop? How many records are you looping through?

Very little should ever be done in a while loop. SQL server is much more efficient using set-based statments.

For instance if you are updating the recordset one record at a time (as you do in a loop) and there are 1,000,000 records, you are running 1,000,000 update statements. If you use a set-based update statment, then you run one statement.

Questions about posting. See faq183-874
 
I have to find all of the expenses during the course of a project (anywhere from 1 month to infinite) sorted by month. I also have to find out if these expenses have been costed off through the accounting software Sirius.
(I was originally just going to search on expense item and date, expense doesn't have an unique id that is accessable prior to query.)

I am now getting all of the expenses for the specific project out of sirius after getting all of the expenses from SQL.

I start a loop for DB.Expenses, at each loop I have to see if it is in Sirius.Expenses.

So it is something like this
Do while not DB.Expenses.eof
Do while not Sirius.Expenses.value
if DB.Expenses.value = Sirius.Expenses.value then
monthValue = monthValue + Expenses.value
exit do
end if
Sirius.Expenses.movenext
Loop
Sirius.Expenses.movefirst
DB.Expenses.movenext

I realize that this is not the most efficient course of action but I can't think of any other way to do it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top