Home All Groups Group Topic Archive Search About
Author
3 Apr 2006 4:53 PM
newsgroups.jd
Thanks in advance -

Trying to get this format returned when selecting a date on a calendar
and having a little difficulty

Format needs to be mmyy/Dayd

Example

Feb 3, 2004  would return 0204\Day3
Dec 15, 2002 would reurn 1202\Day15


Code I have tried

This way actually almost works cept the "y" in "Day" is pulling a 6

Protected Sub Calendar1_SelectionChanged(ByVal sender As Object, ByVal
e As System.EventArgs) Handles Calendar1.SelectionChanged
        Dim selection As String = Format(Calendar1.SelectedDate(),
"MMyy" & "\Day" & "d")
        Response.Redirect("\\server\report\" & selection & ".XLS")
End Sub


Protected Sub Calendar1_SelectionChanged(ByVal sender As Object, ByVal
e As System.EventArgs) Handles Calendar1.SelectionChanged
        Dim monthyear As String = Format(Calendar1.SelectedDate(),
"MMyy")
        Dim day As String = Format(Calendar1.SelectedDate(), "d")
        Dim selection As String = monthyear & "\Day" & day
        Response.Redirect("\\server\report\" & selection & ".XLS")
End Sub

Protected Sub Calendar1_SelectionChanged(ByVal sender As Object, ByVal
e As System.EventArgs) Handles Calendar1.SelectionChanged
        Dim monthyear As String = Format(Calendar1.SelectedDate(),
"MMyy")
        Dim day As String = Format(Calendar1.SelectedDate(), "d")
        Dim selection As String = monthyear & "\Day" & day
        Response.Redirect("\\server\report\" & selection & ".XLS")
End Sub

The response redirect is another problem, but cant move onto that
problem til I get the formating working out...

Thanks!!

JD

Author
3 Apr 2006 5:12 PM
Jim Hughes
Escape the literals with a \

("MMyy" & "\D\a\y" & "d")

The y is being formated as the single digit year.

<newsgroups***@gmail.com> wrote in message
Show quoteHide quote
news:1144083221.458965.277560@g10g2000cwb.googlegroups.com...
> Thanks in advance -
>
> Trying to get this format returned when selecting a date on a calendar
> and having a little difficulty
>
> Format needs to be mmyy/Dayd
>
> Example
>
> Feb 3, 2004  would return 0204\Day3
> Dec 15, 2002 would reurn 1202\Day15
>
>
> Code I have tried
>
> This way actually almost works cept the "y" in "Day" is pulling a 6
>
> Protected Sub Calendar1_SelectionChanged(ByVal sender As Object, ByVal
> e As System.EventArgs) Handles Calendar1.SelectionChanged
>        Dim selection As String = Format(Calendar1.SelectedDate(),
> "MMyy" & "\Day" & "d")
>        Response.Redirect("\\server\report\" & selection & ".XLS")
> End Sub
>
>
> Protected Sub Calendar1_SelectionChanged(ByVal sender As Object, ByVal
> e As System.EventArgs) Handles Calendar1.SelectionChanged
>        Dim monthyear As String = Format(Calendar1.SelectedDate(),
> "MMyy")
>        Dim day As String = Format(Calendar1.SelectedDate(), "d")
>        Dim selection As String = monthyear & "\Day" & day
>        Response.Redirect("\\server\report\" & selection & ".XLS")
> End Sub
>
> Protected Sub Calendar1_SelectionChanged(ByVal sender As Object, ByVal
> e As System.EventArgs) Handles Calendar1.SelectionChanged
>        Dim monthyear As String = Format(Calendar1.SelectedDate(),
> "MMyy")
>        Dim day As String = Format(Calendar1.SelectedDate(), "d")
>        Dim selection As String = monthyear & "\Day" & day
>        Response.Redirect("\\server\report\" & selection & ".XLS")
> End Sub
>
> The response redirect is another problem, but cant move onto that
> problem til I get the formating working out...
>
> Thanks!!
>
> JD
>
Author
5 Apr 2006 3:43 PM
newsgroups.jd
Thanks - that did did the trick - had to add another \ to end of MMyy

("MMyy\" & "\D\a\y" & "d")

JD