i do have date problem in sql server, i m using DD/MM/YYYY date format, & passing it to insert & update stat...& compairing it with data in table, which is not working properly, how to convert dd/mm/yyyy to mm/dd/yyyy or yyyy-mm-dd
hoping for solution soon, thanx
murli .....
Use the yyyy-mm-dd format to interact with sql server, you will be safe.I think you are using a textbox to get the date from the user.
Try
Dim strDate() as String = txtDate.Text.Split("/"c)
if user inputs 06/08/2005
strDate(0) will contain 06
strDate(1) will contain 08
strDate(2) will contain 2005
You can now go on from here.
|||
thanx for ur reply ...
but its not working,
Dim strdate()AsString = hidDate.Value.Split("/"c)
it is not splitting date .. showing whole date at strdate(0). ...
Murli ....
|||
hidate is html hidden control having property runat=server assign to it ...
i have created function for that to change format using indexof & substring property ...
thanx 4 ur help ...
murli ...
Dim strdate()AsString = hidDate.Value.ToString.Split("/"c)
|||I had replied before... but I think there might be an error in submission.
Try
Dim strdate()AsString = hidDate.Value.ToString.Split("/"c)
|||Try using the convert function is SQL. Do a search on SQL Convert() and you should be able to do it without splitting the date.
No comments:
Post a Comment