Mainly because I didn't know of that method - I was just trying to
save the poster some work, as the first reply didn't suggest a
solution.
Thanks for the tip anyway
"Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in message news:<18adnReVjLZ6GejcRVn-1Q@rogers.com>...[color=blue]
> Why bother with functions like that, Terry? All you need is the built-in
> Format function.
>
> See
http://www.mvps.org/access/datetime/date0005.htm at "The Access Web" for
> a far simpler approach.
>
> --
> Doug Steele, Microsoft Access MVP
>
http://I.Am/DougSteele
> (no e-mails, please!)
>
>
>
> "Terry Bell" <dreadnought8@hotmail.com> wrote in message
> news:923537d6.0410190531.115b7af7@posting.google.c om...[color=green]
> > You might find these handy:
> >
> > Function MakeUSDate(x As Variant)
> > If Not IsDate(x) Then Exit Function
> > MakeUSDate = "#" & Format(Month(x), "00") & "/" & Format(Day(x), "00")
> > & "/" & Format(Year(x), "0000") & "#"
> > End Function
> >
> > Public Function MakeUSDateTime(InDateTime) As String
> > 'returns a datestring in the form #mm/dd/yy hh:nn# - to the minute
> > Dim a As String, b As String, c As String, Tm As String
> > a = MakeUSDate(InDateTime)
> > b = Left(a, Len(a) - 1)
> > Tm = Format(DatePart("h", InDateTime), "00") & ":" &
> > Format(DatePart("n", InDateTime), "00")
> > MakeUSDateTime = b & " " & Tm & "#"
> > End Function
> >
> > Public Function MakeUSDateExactTime(InDateTime) As String
> > 'returns a datestring in the form #mm/dd/yy hh:nn# - to the second
> > Dim a As String, b As String, c As String, Tm As String
> > a = MakeUSDate(InDateTime)
> > b = Left(a, Len(a) - 1)
> > Tm = Format(DatePart("h", InDateTime), "00") & ":" &
> > Format(DatePart("n", InDateTime), "00") & ":" & Format(DatePart("s",
> > InDateTime), "00")
> > MakeUSDateExactTime = b & " " & Tm & "#"
> > End
Functionclarkou@memrb.com.cy (CLarkou) wrote in message[/color]
> news:<db08d9f5.0410182138.580f84bb@posting.google. com>...[color=green][color=darkred]
> > > I have a field with dates in an Access database. The format of date is
> > > short date "19/06/2004". In my regional settings I have as date format
> > > "dd/mm/yyyy".
> > >
> > > When I create a query from design to get the data from 10/01/2004 in
> > > criteria I type #10/01/2004#. In SQL I checked and had #1/10/2004#
> > > which is opposite.
> > >
> > > The problem is that I am creating query from VBA and by settings date
> > > to be #10/01/2004#, I don't get any records. When I create it from
> > > DESIGN I get results.
> > >
> > > Is there a reason for this ?[/color][/color][/color]