Last post Jun 14, 2016 03:03 AM by Yohann Lu
Jun 13, 2016 10:26 PM|kmcnet|LINK
Hello everyone and thanks for your help in advance. I have a WebApi interface that accepts various dates:
Function GetWellCheckList(ByVal Insurance As String, LowerDOBRange As String, UpperDOBRange As String, LastVisitLowerRange As String, LastWellVisit As String)
I am passing the dates as strings in order to simplify the ajax calls, however, I am having problems with the SQL query once the dates are transmitted. I think the problem is the format of the date, for example 6/13/2016. I tried varipus parsing methods
Dim TestTime As DateTime = DateTime.ParseExact(LowerDOBRange, "d", CultureInfo.InvariantCulture)
but I can't seem to get the datetime to format correctly. The SQL query expects the following values:
Any help would be appreciated.
Jun 14, 2016 03:03 AM|Yohann Lu|LINK
From your description, I cannot clearly understand your specific problem. So, I suggest you should check the following options firstly.
1: Does your dates string received correctly in your Web API.
2: What is your correct date format
3: Does your SQL query can be performed properly in SQL editor and return data.
You should debug your code steps by steps and find which code cause your problem and share us more relevant code.