klb37777
asked on
Get rid of special characters when pulling a SQL field
How do I get a field from a table and get rid of all the $ . or ,? AND is this right to get rid of the / in date of a field in sql?
The example I am using is from VB and I need this to work in VB.net.
1: field to get rid of $ . and , are:
inv_amt
2: the fields from SQL are inv_dat and rpt_date:
invdatebat = Format(rst!inv_dat, "mmddyy")
rptdatebat = Format(rst!inv_date, "mmddyy")
Thanks in advance for the help.
The example I am using is from VB and I need this to work in VB.net.
1: field to get rid of $ . and , are:
inv_amt
2: the fields from SQL are inv_dat and rpt_date:
invdatebat = Format(rst!inv_dat, "mmddyy")
rptdatebat = Format(rst!inv_date, "mmddyy")
Thanks in advance for the help.
also this
http://www.rgagnon.com/jsdetails/js-0063.html
For dates
DATEVARIABLE.ToString("dd/ mm/yyyy")
http://www.rgagnon.com/jsdetails/js-0063.html
For dates
DATEVARIABLE.ToString("dd/
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Baan: are you assuming that the field name in the table is inv_amt?
nishikanth: not sure if I can use that here, but it may be useful regardless.
nishikanth: not sure if I can use that here, but it may be useful regardless.
ya... isn't it ? oops....
ASKER
no...i didn't tell you what it was...LOL it is inv_amt, rpt_date, inv_dat
I thought this is your new project....
well, you still can do the same thing... question is WHEN ?.. ok, whenever you get the values and store it to the variables. If you are unsure of getting the values from database... well, my first choice is DataReader. Because, you are going to read the dataTable rows one by one. I would suggest first concentrate on reading the values from database. Then comes formatting.
If you have already done it, show me how you did it ? Then I can help in formatting. :)
well, you still can do the same thing... question is WHEN ?.. ok, whenever you get the values and store it to the variables. If you are unsure of getting the values from database... well, my first choice is DataReader. Because, you are going to read the dataTable rows one by one. I would suggest first concentrate on reading the values from database. Then comes formatting.
If you have already done it, show me how you did it ? Then I can help in formatting. :)
ASKER
This is a new part of the project...the last big thing...it was suppose to have been done differently pulled from the tables and sent thru DTS pkg, of course not - not for me....
Thanks for the help, b/c I am so confused with this part. As for the main application, I just have to get that onfocus working and the reformat at the end and it should be okay for deployment. So far I haven't gotten those to worked out yet though. :(
Let me close this question since you answered my question...thanks!!!
Thanks for the help, b/c I am so confused with this part. As for the main application, I just have to get that onfocus working and the reformat at the end and it should be okay for deployment. So far I haven't gotten those to worked out yet though. :(
Let me close this question since you answered my question...thanks!!!
String.Format("{0:c}",x);
where X is the VAriable...
------------
Dim nValue as Integer
nValue as Integer=Val(strValue.Text.
If nValue=0 Then ' --> Test for the positive value
nValue=Val(strValue.Text.R
End If
-----------------
Dim converted as string = System.Text.RegularExpress