DwZone Forum DwZone Forum
Welcome to the DwZone-it Forum
 
  FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups  
    RegisterRegister -->   LoginLogin  
Advanced Mail  
DwZone Forum Index -> Advanced Mail

Moderators: AdministratorsModerators 
Hint: For improved responsiveness, use Internet Explorer 4 (or above) with Javascript enabled, choose 'Dynamic' from the View dropdown and hit 'Set Options' to save your changes.
New Topic Search for
 View     Per page     Messages Since 
Messages 341 to 350 of 781 (Total: 224) First |  Prev |  Next |  Last  
 Subject Author Date  
    Re:Issue with SQL Stament  
View this persons public profile  gianluigi   8:06 25 Jul 2006  
 
Hi,

To get the last record you have 2 method.

1�) use the "order by" in the sql and order for the ID field in DESC mode, so the first record will be the record you find. In this case you must also put the "TOP 1" parameters in the select.
The result query must be:
SELECT TOP 1 YourTable.* from YourTable ORDER BY ID DESC
this will give you the last record.

2�)Insert an hidden field in the form like
<input type=hidden name=sessionId value="<%=session.sessionId%>" >
Insert a Field in the DB and call this field SessionId
In the insert behavior put the value of the sessionId form field in the sessionId DB field.
Create the query to get the field like:
"SELECT TOP 1 YourTable.* from YourTable where SessionId = '" & session.sessionId & "' ORDER BY ID DESC"
This is a method more sure because if there are 2 user that create the record in the same time with the second you will be sure to get the right record.


Gianluigi

 
Reply to this current thread  View this persons public profile  Send Private Message
   js. error3  
View this persons public profile  [email protected]   23:57 20 Jul 2006  
   Re:js. error3  
View this persons public profile  gianluigi   8:22 21 Jul 2006  
   Re:js. error3  
View this persons public profile  [email protected]   19:05 21 Jul 2006  
   8004005 w/Advanced Mail Insert Record  
View this persons public profile  [email protected]   17:14 12 Jun 2006  
   Re:8004005 w/Advanced Mail Insert Record  
View this persons public profile  gianluigi   19:45 12 Jun 2006  
   Re:8004005 w/Advanced Mail Insert Record  
View this persons public profile  [email protected]   19:54 12 Jun 2006  
   No email if CC or BCC is populated  
View this persons public profile  [email protected]   22:28 8 Jun 2006  
   Re:No email if CC or BCC is populated  
View this persons public profile  gianluigi   19:06 9 Jun 2006  
   Re:No email if CC or BCC is populated  
View this persons public profile  [email protected]   21:13 9 Jun 2006  
Last Visit: Sunday 20 Jul, 2025 0:53 pm First |  Prev |  Next |  Last  
 Login
Username:  Password:    
Read Message Read Message   Unread message Unread message
Read message [popular] Read message [popular]   Unread message [popular] Unread message [popular]
Read message [locked] Read message [locked]   Unread message [locked] Unread message [locked]
All times are GMT-2

Jump to: