Did you try formatting the date field like I suggested? Access will
correctly interpret 23/5/07 as 23 May, 2007 since there is no 23rd month.
However, it will ALWAYS interpret 04/06/07 as 06 April, 2007.
You should probably read Allen Browne's "International Dates in Access"
(
http://www.allenbrowne.com/ser-36.html) , or what I had in my September,
2003 "Access Answers" column in Pinnacle Publication's "Smart Access".
(You
can download the column, and sample database, for free from
http://www.accessmvp.com/DJSteele/SmartAccess.html)
--
Doug Steele, Microsoft Access MVP
(no e-mails, please!)
Doug,
I did try that out but no it doesnt work. the idea behind this is
the
fact that i have a form with the weekly view of the day that children
have
attended the nursery; from here, if i dbl- click on a price e.g. basic
full
day for 23/5/07 (dd/mm/yyyy) then a sub-form appears showing the date
23/5/07
and i can automatically change that session and also see whether a
funded
session has been booked.
I've also tried doing a replace. e.g. if 2 funded sessions are booked
on
23/05 i want to replace ONLY ONE session with a basic pm, it deletes
both
the
funded ones.
Not sure if this makes any sense at all. but its basically 2 problems
that
i
CANT solve.
Thanks once again.
--
Amina...
:
What does 04.06.07 mean to you: 04 June, 2007 or 06 April, 2007? If
it's
dd.mm.yy (and that's what your Regional Settings have set your Short
Date
format), try:
=DFirst("[Id]","[Invoice Items]","[Description]='" & [Forms]![Weekly
Child
View]![Description] & "' AND [Child ID]=" & [Forms]![Children
List].[Form]![Child ID] & " AND [Date]=" & Format([Forms]![Weekly
Child
View]![ChangeDate], "\#yyyy\-mm\-dd\#")
Access doesn't respect Regional Settings w.r.t. dates in SQL
statements.
Also, are you certain that the date field contains just a date, or
might
it
contain date and time (because it was populated with Now(), rather
than
Date())? If it does contain time, try:
" AND [Date] BETWEEN" & Format([Forms]![Weekly Child
View]![ChangeDate],
"\#yyyy\-mm\-dd\#") & " AND " & Format(DateAdd("d", 1,[Forms]![Weekly
Child
View]![ChangeDate]), "\#yyyy\-mm\-dd\#")
--
Doug Steele, Microsoft Access MVP
(no e-mails, please!)
Hi,
I am trying to use the dfirst function to pick the first
description
of
a particular date. e.g first instance where the description 'NEF
Grant'
appears on the 04.06.07.
I have built this which doesn't seem to work.
=DFirst("[Id]","[Invoice Items]","[Description]='" & [Forms]![Weekly
Child
View]![Description] & "' AND [Child ID]=" & [Forms]![Children
List].[Form]![Child ID] & " AND [Date]=#" & [Forms]![Weekly Child
View]![ChangeDate] & "#")
the text box appears blank although there is data to be displayed.
At
first
there wasn't an equals sign at the beginnig, hence showing 'name?#'
but
now
shows blank.
Any idea where I am going wrong?
Any help would be appreciated.
Thanks in advance.