Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 How do I write this?

Author  Topic 

JJ297
Aged Yak Warrior

940 Posts

Posted - 2010-04-20 : 13:36:03
I'm getting an expression expected after the Elseif and end of statement expected after replace="00"

Dim dt As Date
If Trim(stDt) = "" Then
dt = Nothing
Elseif
stDt = "24" replace="00"
Else
dt = Date.ParseExact(stDt, fmt, Nothing)
End If
Return dt
End Function

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-04-20 : 13:49:59
You need to ask your question on a forum that specializes in that programming language. Try the forums over at www.asp.net for instance.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

JJ297
Aged Yak Warrior

940 Posts

Posted - 2010-04-20 : 13:50:46
Okay thanks!
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-04-21 : 01:19:42
you can try like

Dim dt As Date
If Trim(stDt) = "" Then
dt = Nothing
Else
if
stDt = "24" replace="00"
Else
dt = Date.ParseExact(stDt, fmt, Nothing)
End If
End If
Return dt
End Function


------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

JJ297
Aged Yak Warrior

940 Posts

Posted - 2010-04-21 : 13:08:10
Great thanks!
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-04-21 : 23:35:52
welcome

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -