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

Replacing one item in a list......

Status
Not open for further replies.

neomorpheus

Programmer
Mar 9, 2001
47
US
I have a list as below....

SYSDATE,USERNAME,CLIENTIP,URLSTEM,URLQUERY,REFERER,NODEID

I want to be able to replace the SYSDATE in the list as "convert(nvarchar, sysdate,101) as sysdate", so that my revised list would be:

convert(nvarchar, sysdate,101) as sysdate, USERNAME, CLIENTIP, URLSTEM, URLQUERY, REFERER, NODEID

Any help on achieving this is appreciated??? Thanks
 
If you know SYSDATE is always first in the list, you can use the ListSetAt() function like this:
Code:
ListSetAt(yourlist,1,"convert(nvarchar, sysdate,101) as sysdate")

If you don't know the position of the SYSDATE item, you can use the ListFindNoCase() function in addition to the ListSetAt() function:
Code:
ListSetAt(yourlist,ListFindNoCase(yourlist,"SYSDATE"),"convert(nvarchar, sysdate,101) as sysdate")

-Tek
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top