This is the last issue on my plate and it is driving me insane so any help what so ever would be highly appreciated.
I have a page I wrote that needs to allow for a list box that allows the user to select Daily, Weekly, Monthly. The Time / Date Field in the DB is UTC, and I need to check against that.
So in my ChkDay Function i'd like to accomplis the following.
if daily - get today in utc and return all records that match.
if weelky - get the utc and search on a range
Monthly - Same as weekly.
I managed to get today's UTC but for the life of me can't
figure out how to strip it down to just the date..
I striped it down, but here's the start of the function.
the list box would be as follows...
Again any help would be greatly appreciated
I have a page I wrote that needs to allow for a list box that allows the user to select Daily, Weekly, Monthly. The Time / Date Field in the DB is UTC, and I need to check against that.
So in my ChkDay Function i'd like to accomplis the following.
if daily - get today in utc and return all records that match.
if weelky - get the utc and search on a range
Monthly - Same as weekly.
I managed to get today's UTC but for the life of me can't
figure out how to strip it down to just the date..
I striped it down, but here's the start of the function.
Code:
Sub GetChkDay(Sender As Object, E As EventArgs)
Dim dblTtamp As Double = System.Math.Floor( DateTime.Now.Subtract(New DateTime(1970, 1, 1)).TotalSeconds ) ' This gives me the UTC by using 1 line of code
'This breaks it down
Dim dtUTC As DateTime = DateTime.Now
Dim dtStart As New DateTime(1970, 1, 1)
Dim tsDifference As TimeSpan = dtUTC.Subtract(dtStart)
'convert time as CTime
'figure out what the week or month span would be
If MyList.SelectedItem.Value="day" Then
connection info
select * from table where @CTime =""
Else
If MyList.SelectedItem.Value="wkly" Then
connection info
select * from table where timedate Between "@CTime" and "@CTime2"
Else
If MyList.SelectedItem.Value="mon" Then
connection info
select * from table where timedate Between "@CTime" and "@CTime3"
End Sub
the list box would be as follows...
Code:
<asp:dropdownlist id="MyList" runat="server"
Font-Size="XX-Small" OnLoad="ChkDay" >
<asp:ListItem Value="*" Selected=True>
All Open Tickets</asp:ListItem>
<asp:ListItem Value="day">Daily</asp:ListItem>
<asp:ListItem Value="wkly">Weekly</asp:ListItem>
<asp:ListItem Value="mon">Monthly</asp:ListItem>
</asp:dropdownlist><FONT size="1"></FONT>
Again any help would be greatly appreciated