![]() |
| |||||||
| Sponsored Links |
![]() |
| | LinkBack | Thread Tools | Display Modes |
|
#11
| ||||
| ||||
| Hi Wolffy, Can you see what I'm doing wrong here? ![]() Record Results screen, to: Code: <TD><a href="edit.asp?MyID=<%=rs("MyID")%>&RecDate=<%=rs("RecordDt")%>">edit</a></TD>
Code: Dim sMyID,sRecDate
sMyID = Request("MyID")
sRecDate = Request("RecordDt")
Set rs = Server.CreateObject ("ADODB.Recordset")
'build SQL
sSql = "SELECT * FROM dbo.tblTEST"
sSql = sSql & " WHERE MyID='" & sMyID & "' and RecDate='" & sRecDate & "'"
|
| Sponsored Links |
|
#12
| ||||
| ||||
| OK, see what you are trying here. When you get to the Edit screen, you want to make sure that the record you pull up hasn't changed since being displayed on the results screen, right? Sound good to me. Looks like you're pulling "RecordDt" and then comparing to "RecDate" tho. Are this both fields in your table?
__________________ Wolffy ------------------------ Opinions expressed are my own and do not necessity reflect those of any sane person. Any code provided is intended to be an example and is provided AS IS. Rework for your specific environment may be required. Void where prohibited by law. Not valid in California. Your mileage may vary. |
|
#13
| ||||
| ||||
| um...nope, ony RecordDt...is that the problem? |
|
#14
| ||||
| ||||
| Then I think the WHERE clause should be and RecordDt = '" & sRecDate & "'" unless I'm missing sumpin' |
|
#15
| ||||
| ||||
| if i take off the AND and RecordDt = '" & sRecDate & "' ...i get the record... ![]() I have to have that correct? so when I do the update part you suggested... |
|
#16
| ||||
| ||||
| Sorry..what I'm getting at is the field called RecDate or RecordDt? Assuming the field name is correct, I'd then Response.Write the value of sRecDate to ensure it's what you think it is (i.e. not blank, has full date/time not just time, etc). |
|
#17
| ||||
| ||||
| seems to be good Wolffy.... it returned: Code: SELECT * FROM dbo.tblTEST WHERE MyID='249' and RecordDt='10/16/2008 1:29:38 PM' |
|
#18
| ||||
| ||||
| Hmmm...OK, then go and pull up record 249 and see what's there. I suspect that you are truncating the milliseconds from the datetime value as stored in the record and thus not getting a match. Working with datetime values can ugly -- however it's interesting to note that a datetime is stored as a numeric and can be converted to a float. Sometime they can be easier to work with as a numeric value. |
|
#19
| ||||
| ||||
| ok...i checked and this is what it had in it ![]() 10/16/2008 1:29:38 PM datetime(8) |
|
#20
| ||||
| ||||
| I'm still leaning toward truncation of milliseconds here. Run the following query and see what you get: Select cast(RecordDT as float), cast(cast('10/16/2008 1:29:38 PM' as datetime) as float) from dbo.tblTEST WHERE MyID='249' |
![]() |
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to retrieve unknown recordset field names in table? | BLaaaaaaaaaarche | ASP Development | 2 | August 10th, 2008 08:33 AM |
| Help with asp display / recordset (troubleshoot) | Rebelle | ASP Development | 27 | June 30th, 2008 11:19 AM |
| go page to page questionaire app | peebman2000 | .Net Development | 3 | April 26th, 2008 04:42 PM |