If this is your first visit, be sure to check out the FAQ by clicking the link above.
You may have to register before you can post: click the register link above to proceed.
To start viewing messages, select the forum that you want to visit from the selection below.
I have a select query for a record that i want to find that is going to be a number between two other dates that I might not know exactly. Basically I don't know how to write it correctly! Number and datetime are columns in the table.
Here is what I have so far which doesn't work:
select * from table where Number ='27006' and [datetime] between '%2003-08-16%' and '%2003-08-18%'
Sorry about that, end of a long day so I probably wasn't thinking very straight. I will try to explain it better now. I think using number as a column was probably confusing. Lets say I have two columns that in a table and I want to perform a SELECT query on them. One column is called "ID" and the other is called "datetime". There may be multiple instances of the same ID but different datetimes for each e.g. ID equaling 27006 and datetime equaling 2003-05-10 and another record with ID being the same and datetime being something else. What I want to do is make a SELECT query that will search for an ID between two datetimes.
select * from table where ID ='27006' and [datetime] between '%2003-08-16%' and '%2003-08-18%'
I am using a MS SQL database and this will probably be written in ASP.
I hope that makes a bit more sense.