Ask a Question related to Dreamweaver AppDev, Design and Development.
-
Nathon Jones #1
where DATE is BETWEEN startdate and enddate...how?
Hi,
I need a little help with a SELECT statement.
I have an events table in an Access db. The events have a start date and an
end date.
What statement do I need to show events that occur:
i. on or after the event start date
ii. on or before the event end date, but NOT prior to the start date
In Access I have got a simple query that shows me everything that happens on
or after "today" which looks like this:
Field: eventstartdate
Criteria: >=Now()-1
I know it must be some kind of "between" command....!
Any help would be greatly appreciated. Thanks.
Nath.
Nathon Jones Guest
-
JSObject returns wrong date. How can Iextract correct date from digital signature?
I'm trying to extract name and date from digital signatures by using JSObject in Excel VBA, but JSObject returns wrong date. Year, month, hour and... -
#39245 [NEW]: date function generate wrong date with 1162083600 timestamp
From: lohner at aldea dot hu Operating system: Linux PHP version: 5.1.6 PHP Bug Type: Date/time related Bug description: ... -
HIDE IF startdate is the same as enddate
Hi again, I have the following code on my page. I am trying to hide the "eventenddate" if it is the same as the eventdate. <%IF... -
Convert date/time to date in SQL Server 2000 statement
Can this be done? tia -
HowTo Select an ID where a "Date" is between startDate and endDate?
Hello, I have this table ID startDate endDate ------------------------------- 1 04/01/2003 07/30/2003 2 08/01/2003 09/30/2003... -
CMBergin #2
Re: where DATE is BETWEEN startdate and enddate...how?
WHERE Now() BETWEEN eventStart AND eventEnd
"Nathon Jones" <nathonjonesNOT@kirkmoor.com> wrote in message
news:d0hsi2$cs7$1@forums.macromedia.com...an> Hi,
>
> I need a little help with a SELECT statement.
>
> I have an events table in an Access db. The events have a start date andon> end date.
>
> What statement do I need to show events that occur:
>
> i. on or after the event start date
> ii. on or before the event end date, but NOT prior to the start date
>
> In Access I have got a simple query that shows me everything that happens> or after "today" which looks like this:
>
> Field: eventstartdate
> Criteria: >=Now()-1
>
> I know it must be some kind of "between" command....!
> Any help would be greatly appreciated. Thanks.
>
> Nath.
>
>
CMBergin Guest
-
Nathon Jones #3
Re: where DATE is BETWEEN startdate and enddate...how?
Hi again CM!
In Access, in order to show events that happen "today" I have to put:
WHERE eventdate >=Now()-1
Do you know why that is? I notice, in your reply, that you have excluded
that.
Thanks for all your help. Much appreciated.
Nath.
"CMBergin" <NoHarvestForYou@NoSpam.org> wrote in message
news:d0htrt$f3i$1@forums.macromedia.com...> WHERE Now() BETWEEN eventStart AND eventEnd
>
> "Nathon Jones" <nathonjonesNOT@kirkmoor.com> wrote in message
> news:d0hsi2$cs7$1@forums.macromedia.com...> an>> Hi,
>>
>> I need a little help with a SELECT statement.
>>
>> I have an events table in an Access db. The events have a start date and> on>> end date.
>>
>> What statement do I need to show events that occur:
>>
>> i. on or after the event start date
>> ii. on or before the event end date, but NOT prior to the start date
>>
>> In Access I have got a simple query that shows me everything that happens>>> or after "today" which looks like this:
>>
>> Field: eventstartdate
>> Criteria: >=Now()-1
>>
>> I know it must be some kind of "between" command....!
>> Any help would be greatly appreciated. Thanks.
>>
>> Nath.
>>
>>
>
Nathon Jones Guest
-
CMBergin #4
Re: where DATE is BETWEEN startdate and enddate...how?
Now returns date as well as time. If you just have a date in your database,
then it's considered that day at midnight. So if you have >= Now() today at
3pm, then an even listed in the database as today (no time) takes place at
midnight.
'3/6/2005' < '3/6/2005 15:00:00', so you don't get any events.
My comparison goes in the opposite order, so you don't have to worry about
it.
'3/6/2005 15:00:00' BETWEEN '3/6/2005' AND '3/7/3005' will work since 3pm is
after midnight. You may have to add 1 to the end date depending on how you
want the display to work. Not adding 1 - event disappears on the end date.
Adding 1 - shows on the end date, but not after.
"Nathon Jones" <nathonjonesNOT@kirkmoor.com> wrote in message
news:d0hva7$hek$1@forums.macromedia.com...and> Hi again CM!
>
> In Access, in order to show events that happen "today" I have to put:
>
> WHERE eventdate >=Now()-1
>
> Do you know why that is? I notice, in your reply, that you have excluded
> that.
>
> Thanks for all your help. Much appreciated.
> Nath.
>
> "CMBergin" <NoHarvestForYou@NoSpam.org> wrote in message
> news:d0htrt$f3i$1@forums.macromedia.com...> > WHERE Now() BETWEEN eventStart AND eventEnd
> >
> > "Nathon Jones" <nathonjonesNOT@kirkmoor.com> wrote in message
> > news:d0hsi2$cs7$1@forums.macromedia.com...> >> Hi,
> >>
> >> I need a little help with a SELECT statement.
> >>
> >> I have an events table in an Access db. The events have a start datehappens> > an> >> end date.
> >>
> >> What statement do I need to show events that occur:
> >>
> >> i. on or after the event start date
> >> ii. on or before the event end date, but NOT prior to the start date
> >>
> >> In Access I have got a simple query that shows me everything that>> > on> >> >> or after "today" which looks like this:
> >>
> >> Field: eventstartdate
> >> Criteria: >=Now()-1
> >>
> >> I know it must be some kind of "between" command....!
> >> Any help would be greatly appreciated. Thanks.
> >>
> >> Nath.
> >>
> >>
> >
>
CMBergin Guest
-
Nathon Jones #5
Re: where DATE is BETWEEN startdate and enddate...how?
Thank you CM,
I think I am finally getting somewhere.
What is the statement required for a "does not equal"?
startdate (does not equal) enddate?
I tried = = but that didn't work, then I tried <> but that didn't work
either.
Thanks again
Nath.
"CMBergin" <NoHarvestForYou@NoSpam.org> wrote in message
news:d0i0sk$k3o$1@forums.macromedia.com...> Now returns date as well as time. If you just have a date in your
> database,
> then it's considered that day at midnight. So if you have >= Now() today
> at
> 3pm, then an even listed in the database as today (no time) takes place at
> midnight.
> '3/6/2005' < '3/6/2005 15:00:00', so you don't get any events.
>
> My comparison goes in the opposite order, so you don't have to worry about
> it.
> '3/6/2005 15:00:00' BETWEEN '3/6/2005' AND '3/7/3005' will work since 3pm
> is
> after midnight. You may have to add 1 to the end date depending on how
> you
> want the display to work. Not adding 1 - event disappears on the end
> date.
> Adding 1 - shows on the end date, but not after.
>
> "Nathon Jones" <nathonjonesNOT@kirkmoor.com> wrote in message
> news:d0hva7$hek$1@forums.macromedia.com...> and>> Hi again CM!
>>
>> In Access, in order to show events that happen "today" I have to put:
>>
>> WHERE eventdate >=Now()-1
>>
>> Do you know why that is? I notice, in your reply, that you have excluded
>> that.
>>
>> Thanks for all your help. Much appreciated.
>> Nath.
>>
>> "CMBergin" <NoHarvestForYou@NoSpam.org> wrote in message
>> news:d0htrt$f3i$1@forums.macromedia.com...>> > WHERE Now() BETWEEN eventStart AND eventEnd
>> >
>> > "Nathon Jones" <nathonjonesNOT@kirkmoor.com> wrote in message
>> > news:d0hsi2$cs7$1@forums.macromedia.com...
>> >> Hi,
>> >>
>> >> I need a little help with a SELECT statement.
>> >>
>> >> I have an events table in an Access db. The events have a start date> happens>> > an
>> >> end date.
>> >>
>> >> What statement do I need to show events that occur:
>> >>
>> >> i. on or after the event start date
>> >> ii. on or before the event end date, but NOT prior to the start date
>> >>
>> >> In Access I have got a simple query that shows me everything that>>>>> > on
>> >> or after "today" which looks like this:
>> >>
>> >> Field: eventstartdate
>> >> Criteria: >=Now()-1
>> >>
>> >> I know it must be some kind of "between" command....!
>> >> Any help would be greatly appreciated. Thanks.
>> >>
>> >> Nath.
>> >>
>> >>
>> >
>> >
>>
>
Nathon Jones Guest
-
CMBergin #6
Re: where DATE is BETWEEN startdate and enddate...how?
For Access, it's <>. Something else is tripping up the query.
"Nathon Jones" <nathonjonesNOT@kirkmoor.com> wrote in message
news:d0i6hb$o$1@forums.macromedia.com...today> Thank you CM,
>
> I think I am finally getting somewhere.
>
> What is the statement required for a "does not equal"?
>
> startdate (does not equal) enddate?
>
> I tried = = but that didn't work, then I tried <> but that didn't work
> either.
>
> Thanks again
> Nath.
>
> "CMBergin" <NoHarvestForYou@NoSpam.org> wrote in message
> news:d0i0sk$k3o$1@forums.macromedia.com...> > Now returns date as well as time. If you just have a date in your
> > database,
> > then it's considered that day at midnight. So if you have >= Now()at> > at
> > 3pm, then an even listed in the database as today (no time) takes placeabout> > midnight.
> > '3/6/2005' < '3/6/2005 15:00:00', so you don't get any events.
> >
> > My comparison goes in the opposite order, so you don't have to worry3pm> > it.
> > '3/6/2005 15:00:00' BETWEEN '3/6/2005' AND '3/7/3005' will work sinceexcluded> > is
> > after midnight. You may have to add 1 to the end date depending on how
> > you
> > want the display to work. Not adding 1 - event disappears on the end
> > date.
> > Adding 1 - shows on the end date, but not after.
> >
> > "Nathon Jones" <nathonjonesNOT@kirkmoor.com> wrote in message
> > news:d0hva7$hek$1@forums.macromedia.com...> >> Hi again CM!
> >>
> >> In Access, in order to show events that happen "today" I have to put:
> >>
> >> WHERE eventdate >=Now()-1
> >>
> >> Do you know why that is? I notice, in your reply, that you havedate> >> that.
> >>
> >> Thanks for all your help. Much appreciated.
> >> Nath.
> >>
> >> "CMBergin" <NoHarvestForYou@NoSpam.org> wrote in message
> >> news:d0htrt$f3i$1@forums.macromedia.com...
> >> > WHERE Now() BETWEEN eventStart AND eventEnd
> >> >
> >> > "Nathon Jones" <nathonjonesNOT@kirkmoor.com> wrote in message
> >> > news:d0hsi2$cs7$1@forums.macromedia.com...
> >> >> Hi,
> >> >>
> >> >> I need a little help with a SELECT statement.
> >> >>
> >> >> I have an events table in an Access db. The events have a startdate> > and> >> > an
> >> >> end date.
> >> >>
> >> >> What statement do I need to show events that occur:
> >> >>
> >> >> i. on or after the event start date
> >> >> ii. on or before the event end date, but NOT prior to the start>> > happens> >> >>
> >> >> In Access I have got a simple query that shows me everything that> >> >> > on
> >> >> or after "today" which looks like this:
> >> >>
> >> >> Field: eventstartdate
> >> >> Criteria: >=Now()-1
> >> >>
> >> >> I know it must be some kind of "between" command....!
> >> >> Any help would be greatly appreciated. Thanks.
> >> >>
> >> >> Nath.
> >> >>
> >> >>
> >> >
> >> >
> >>
> >>
> >
>
CMBergin Guest
-
Nathon Jones #7
Re: where DATE is BETWEEN startdate and enddate...how?
Hi again,
I have the following code on my page. I am trying to hide the
"eventenddate" if it is the same as the eventdate.
<%IF (rsDateMatch.Fields.Item("eventenddate").Value) <>
"<%=(rsDateMatch.Fields.Item('eventdate').Value)%> " Then%>
- <%= DoDateTime((rsDateMatch.Fields.Item("eventenddate" ).Value), 1, 2057)
%><br>
<%End IF%>
The above is giving me:
Microsoft VBScript compilation (0x800A0409)
Unterminated string constant
So I tried:
<%IF (rsDateMatch.Fields.Item("eventenddate").Value) <>
"(rsDateMatch.Fields.Item('eventdate').Value)" Then%>
- <%= DoDateTime((rsDateMatch.Fields.Item("eventenddate" ).Value), 1, 2057)
%><br>
<%End IF%>
But this is showing me both the start date and the end date, even if they
are the same.
Hope you can help.
Nath.
"CMBergin" <NoHarvestForYou@NoSpam.org> wrote in message
news:d0i7e5$1gh$1@forums.macromedia.com...> For Access, it's <>. Something else is tripping up the query.
>
>
> "Nathon Jones" <nathonjonesNOT@kirkmoor.com> wrote in message
> news:d0i6hb$o$1@forums.macromedia.com...> today>> Thank you CM,
>>
>> I think I am finally getting somewhere.
>>
>> What is the statement required for a "does not equal"?
>>
>> startdate (does not equal) enddate?
>>
>> I tried = = but that didn't work, then I tried <> but that didn't work
>> either.
>>
>> Thanks again
>> Nath.
>>
>> "CMBergin" <NoHarvestForYou@NoSpam.org> wrote in message
>> news:d0i0sk$k3o$1@forums.macromedia.com...>> > Now returns date as well as time. If you just have a date in your
>> > database,
>> > then it's considered that day at midnight. So if you have >= Now()> at>> > at
>> > 3pm, then an even listed in the database as today (no time) takes place> about>> > midnight.
>> > '3/6/2005' < '3/6/2005 15:00:00', so you don't get any events.
>> >
>> > My comparison goes in the opposite order, so you don't have to worry> 3pm>> > it.
>> > '3/6/2005 15:00:00' BETWEEN '3/6/2005' AND '3/7/3005' will work since> excluded>> > is
>> > after midnight. You may have to add 1 to the end date depending on how
>> > you
>> > want the display to work. Not adding 1 - event disappears on the end
>> > date.
>> > Adding 1 - shows on the end date, but not after.
>> >
>> > "Nathon Jones" <nathonjonesNOT@kirkmoor.com> wrote in message
>> > news:d0hva7$hek$1@forums.macromedia.com...
>> >> Hi again CM!
>> >>
>> >> In Access, in order to show events that happen "today" I have to put:
>> >>
>> >> WHERE eventdate >=Now()-1
>> >>
>> >> Do you know why that is? I notice, in your reply, that you have> date>> >> that.
>> >>
>> >> Thanks for all your help. Much appreciated.
>> >> Nath.
>> >>
>> >> "CMBergin" <NoHarvestForYou@NoSpam.org> wrote in message
>> >> news:d0htrt$f3i$1@forums.macromedia.com...
>> >> > WHERE Now() BETWEEN eventStart AND eventEnd
>> >> >
>> >> > "Nathon Jones" <nathonjonesNOT@kirkmoor.com> wrote in message
>> >> > news:d0hsi2$cs7$1@forums.macromedia.com...
>> >> >> Hi,
>> >> >>
>> >> >> I need a little help with a SELECT statement.
>> >> >>
>> >> >> I have an events table in an Access db. The events have a start> date>> > and
>> >> > an
>> >> >> end date.
>> >> >>
>> >> >> What statement do I need to show events that occur:
>> >> >>
>> >> >> i. on or after the event start date
>> >> >> ii. on or before the event end date, but NOT prior to the start>>>>> >> >>
>> >> >> In Access I have got a simple query that shows me everything that
>> > happens
>> >> > on
>> >> >> or after "today" which looks like this:
>> >> >>
>> >> >> Field: eventstartdate
>> >> >> Criteria: >=Now()-1
>> >> >>
>> >> >> I know it must be some kind of "between" command....!
>> >> >> Any help would be greatly appreciated. Thanks.
>> >> >>
>> >> >> Nath.
>> >> >>
>> >> >>
>> >> >
>> >> >
>> >>
>> >>
>> >
>> >
>>
>
Nathon Jones Guest
-
CMBergin #8
Re: where DATE is BETWEEN startdate and enddate...how?
Yeah, too many strings and not enough values. :)
<% %> denotes a script block. Once you've opened a script block, you don't
need to open another. You're already on the server.
<%
If rsDateMatch.Fields.Item("eventenddate").value <>
rsDateMatch.Fields.Item("eventdate").Value) Then
Response.Write(DoDateTime((rsDateMatch.Fields.Item ("eventenddate").Value),1,
2057) & "<br>")
End If
%>
<%= %> is nothing more than a shortcut for <%Response.Write()%>
"Nathon Jones" <nathonjonesNOT@kirkmoor.com> wrote in message
news:d0jtpe$fqh$1@forums.macromedia.com...2057)> Hi again,
>
> I have the following code on my page. I am trying to hide the
> "eventenddate" if it is the same as the eventdate.
>
> <%IF (rsDateMatch.Fields.Item("eventenddate").Value) <>
> "<%=(rsDateMatch.Fields.Item('eventdate').Value)%> " Then%>
> - <%= DoDateTime((rsDateMatch.Fields.Item("eventenddate" ).Value), 1,2057)> %><br>
> <%End IF%>
>
> The above is giving me:
> Microsoft VBScript compilation (0x800A0409)
> Unterminated string constant
>
> So I tried:
>
> <%IF (rsDateMatch.Fields.Item("eventenddate").Value) <>
> "(rsDateMatch.Fields.Item('eventdate').Value)" Then%>
> - <%= DoDateTime((rsDateMatch.Fields.Item("eventenddate" ).Value), 1,place> %><br>
> <%End IF%>
>
> But this is showing me both the start date and the end date, even if they
> are the same.
>
> Hope you can help.
> Nath.
>
>
> "CMBergin" <NoHarvestForYou@NoSpam.org> wrote in message
> news:d0i7e5$1gh$1@forums.macromedia.com...> > For Access, it's <>. Something else is tripping up the query.
> >
> >
> > "Nathon Jones" <nathonjonesNOT@kirkmoor.com> wrote in message
> > news:d0i6hb$o$1@forums.macromedia.com...> > today> >> Thank you CM,
> >>
> >> I think I am finally getting somewhere.
> >>
> >> What is the statement required for a "does not equal"?
> >>
> >> startdate (does not equal) enddate?
> >>
> >> I tried = = but that didn't work, then I tried <> but that didn't work
> >> either.
> >>
> >> Thanks again
> >> Nath.
> >>
> >> "CMBergin" <NoHarvestForYou@NoSpam.org> wrote in message
> >> news:d0i0sk$k3o$1@forums.macromedia.com...
> >> > Now returns date as well as time. If you just have a date in your
> >> > database,
> >> > then it's considered that day at midnight. So if you have >= Now()> >> > at
> >> > 3pm, then an even listed in the database as today (no time) takeshow> > at> > about> >> > midnight.
> >> > '3/6/2005' < '3/6/2005 15:00:00', so you don't get any events.
> >> >
> >> > My comparison goes in the opposite order, so you don't have to worry> > 3pm> >> > it.
> >> > '3/6/2005 15:00:00' BETWEEN '3/6/2005' AND '3/7/3005' will work since> >> > is
> >> > after midnight. You may have to add 1 to the end date depending onput:> >> > you
> >> > want the display to work. Not adding 1 - event disappears on the end
> >> > date.
> >> > Adding 1 - shows on the end date, but not after.
> >> >
> >> > "Nathon Jones" <nathonjonesNOT@kirkmoor.com> wrote in message
> >> > news:d0hva7$hek$1@forums.macromedia.com...
> >> >> Hi again CM!
> >> >>
> >> >> In Access, in order to show events that happen "today" I have to>> > excluded> >> >>
> >> >> WHERE eventdate >=Now()-1
> >> >>
> >> >> Do you know why that is? I notice, in your reply, that you have> > date> >> >> that.
> >> >>
> >> >> Thanks for all your help. Much appreciated.
> >> >> Nath.
> >> >>
> >> >> "CMBergin" <NoHarvestForYou@NoSpam.org> wrote in message
> >> >> news:d0htrt$f3i$1@forums.macromedia.com...
> >> >> > WHERE Now() BETWEEN eventStart AND eventEnd
> >> >> >
> >> >> > "Nathon Jones" <nathonjonesNOT@kirkmoor.com> wrote in message
> >> >> > news:d0hsi2$cs7$1@forums.macromedia.com...
> >> >> >> Hi,
> >> >> >>
> >> >> >> I need a little help with a SELECT statement.
> >> >> >>
> >> >> >> I have an events table in an Access db. The events have a start> > date> >> > and
> >> >> > an
> >> >> >> end date.
> >> >> >>
> >> >> >> What statement do I need to show events that occur:
> >> >> >>
> >> >> >> i. on or after the event start date
> >> >> >> ii. on or before the event end date, but NOT prior to the start> >> >> >> >>
> >> >> >> In Access I have got a simple query that shows me everything that
> >> > happens
> >> >> > on
> >> >> >> or after "today" which looks like this:
> >> >> >>
> >> >> >> Field: eventstartdate
> >> >> >> Criteria: >=Now()-1
> >> >> >>
> >> >> >> I know it must be some kind of "between" command....!
> >> >> >> Any help would be greatly appreciated. Thanks.
> >> >> >>
> >> >> >> Nath.
> >> >> >>
> >> >> >>
> >> >> >
> >> >> >
> >> >>
> >> >>
> >> >
> >> >
> >>
> >>
> >
>
CMBergin Guest
-
Nathon Jones #9
Re: where DATE is BETWEEN startdate and enddate...how?
Thanks CM,
I tried this:
<%IF (rsDateMatch.Fields.Item("eventenddate").Value) <>
(rsDateMatch.Fields.Item("eventdate").Value) Then%>
- <%= DoDateTime((rsDateMatch.Fields.Item("eventenddate" ).Value), 1, 2057)
%>
<%End IF%>
And it works a treat. Thanks for all your help.
Nath.
"CMBergin" <NoHarvestForYou@NoSpam.org> wrote in message
news:d0k8jb$2s6$1@forums.macromedia.com...> Yeah, too many strings and not enough values. :)
> <% %> denotes a script block. Once you've opened a script block, you
> don't
> need to open another. You're already on the server.
>
> <%
> If rsDateMatch.Fields.Item("eventenddate").value <>
> rsDateMatch.Fields.Item("eventdate").Value) Then
>
> Response.Write(DoDateTime((rsDateMatch.Fields.Item ("eventenddate").Value),1,
> 2057) & "<br>")
> End If
> %>
>
> <%= %> is nothing more than a shortcut for <%Response.Write()%>
>
> "Nathon Jones" <nathonjonesNOT@kirkmoor.com> wrote in message
> news:d0jtpe$fqh$1@forums.macromedia.com...> 2057)>> Hi again,
>>
>> I have the following code on my page. I am trying to hide the
>> "eventenddate" if it is the same as the eventdate.
>>
>> <%IF (rsDateMatch.Fields.Item("eventenddate").Value) <>
>> "<%=(rsDateMatch.Fields.Item('eventdate').Value)%> " Then%>
>> - <%= DoDateTime((rsDateMatch.Fields.Item("eventenddate" ).Value), 1,> 2057)>> %><br>
>> <%End IF%>
>>
>> The above is giving me:
>> Microsoft VBScript compilation (0x800A0409)
>> Unterminated string constant
>>
>> So I tried:
>>
>> <%IF (rsDateMatch.Fields.Item("eventenddate").Value) <>
>> "(rsDateMatch.Fields.Item('eventdate').Value)" Then%>
>> - <%= DoDateTime((rsDateMatch.Fields.Item("eventenddate" ).Value), 1,> place>> %><br>
>> <%End IF%>
>>
>> But this is showing me both the start date and the end date, even if they
>> are the same.
>>
>> Hope you can help.
>> Nath.
>>
>>
>> "CMBergin" <NoHarvestForYou@NoSpam.org> wrote in message
>> news:d0i7e5$1gh$1@forums.macromedia.com...>> > For Access, it's <>. Something else is tripping up the query.
>> >
>> >
>> > "Nathon Jones" <nathonjonesNOT@kirkmoor.com> wrote in message
>> > news:d0i6hb$o$1@forums.macromedia.com...
>> >> Thank you CM,
>> >>
>> >> I think I am finally getting somewhere.
>> >>
>> >> What is the statement required for a "does not equal"?
>> >>
>> >> startdate (does not equal) enddate?
>> >>
>> >> I tried = = but that didn't work, then I tried <> but that didn't work
>> >> either.
>> >>
>> >> Thanks again
>> >> Nath.
>> >>
>> >> "CMBergin" <NoHarvestForYou@NoSpam.org> wrote in message
>> >> news:d0i0sk$k3o$1@forums.macromedia.com...
>> >> > Now returns date as well as time. If you just have a date in your
>> >> > database,
>> >> > then it's considered that day at midnight. So if you have >= Now()
>> > today
>> >> > at
>> >> > 3pm, then an even listed in the database as today (no time) takes> how>> > at
>> >> > midnight.
>> >> > '3/6/2005' < '3/6/2005 15:00:00', so you don't get any events.
>> >> >
>> >> > My comparison goes in the opposite order, so you don't have to worry
>> > about
>> >> > it.
>> >> > '3/6/2005 15:00:00' BETWEEN '3/6/2005' AND '3/7/3005' will work
>> >> > since
>> > 3pm
>> >> > is
>> >> > after midnight. You may have to add 1 to the end date depending on> put:>> >> > you
>> >> > want the display to work. Not adding 1 - event disappears on the
>> >> > end
>> >> > date.
>> >> > Adding 1 - shows on the end date, but not after.
>> >> >
>> >> > "Nathon Jones" <nathonjonesNOT@kirkmoor.com> wrote in message
>> >> > news:d0hva7$hek$1@forums.macromedia.com...
>> >> >> Hi again CM!
>> >> >>
>> >> >> In Access, in order to show events that happen "today" I have to>>>>> >> >>
>> >> >> WHERE eventdate >=Now()-1
>> >> >>
>> >> >> Do you know why that is? I notice, in your reply, that you have
>> > excluded
>> >> >> that.
>> >> >>
>> >> >> Thanks for all your help. Much appreciated.
>> >> >> Nath.
>> >> >>
>> >> >> "CMBergin" <NoHarvestForYou@NoSpam.org> wrote in message
>> >> >> news:d0htrt$f3i$1@forums.macromedia.com...
>> >> >> > WHERE Now() BETWEEN eventStart AND eventEnd
>> >> >> >
>> >> >> > "Nathon Jones" <nathonjonesNOT@kirkmoor.com> wrote in message
>> >> >> > news:d0hsi2$cs7$1@forums.macromedia.com...
>> >> >> >> Hi,
>> >> >> >>
>> >> >> >> I need a little help with a SELECT statement.
>> >> >> >>
>> >> >> >> I have an events table in an Access db. The events have a start
>> > date
>> >> > and
>> >> >> > an
>> >> >> >> end date.
>> >> >> >>
>> >> >> >> What statement do I need to show events that occur:
>> >> >> >>
>> >> >> >> i. on or after the event start date
>> >> >> >> ii. on or before the event end date, but NOT prior to the start
>> > date
>> >> >> >>
>> >> >> >> In Access I have got a simple query that shows me everything
>> >> >> >> that
>> >> > happens
>> >> >> > on
>> >> >> >> or after "today" which looks like this:
>> >> >> >>
>> >> >> >> Field: eventstartdate
>> >> >> >> Criteria: >=Now()-1
>> >> >> >>
>> >> >> >> I know it must be some kind of "between" command....!
>> >> >> >> Any help would be greatly appreciated. Thanks.
>> >> >> >>
>> >> >> >> Nath.
>> >> >> >>
>> >> >> >>
>> >> >> >
>> >> >> >
>> >> >>
>> >> >>
>> >> >
>> >> >
>> >>
>> >>
>> >
>> >
>>
>
Nathon Jones Guest
-
CMBergin #10
Re: where DATE is BETWEEN startdate and enddate...how?
Same thing, just more typing. :)
Glad everything's working for you.
"Nathon Jones" <nathonjonesNOT@kirkmoor.com> wrote in message
news:d0k8pu$35b$1@forums.macromedia.com...2057)> Thanks CM,
>
> I tried this:
>
> <%IF (rsDateMatch.Fields.Item("eventenddate").Value) <>
> (rsDateMatch.Fields.Item("eventdate").Value) Then%>
> - <%= DoDateTime((rsDateMatch.Fields.Item("eventenddate" ).Value), 1,Response.Write(DoDateTime((rsDateMatch.Fields.Item ("eventenddate").Value),1,> %>
> <%End IF%>
>
> And it works a treat. Thanks for all your help.
>
> Nath.
>
> "CMBergin" <NoHarvestForYou@NoSpam.org> wrote in message
> news:d0k8jb$2s6$1@forums.macromedia.com...> > Yeah, too many strings and not enough values. :)
> > <% %> denotes a script block. Once you've opened a script block, you
> > don't
> > need to open another. You're already on the server.
> >
> > <%
> > If rsDateMatch.Fields.Item("eventenddate").value <>
> > rsDateMatch.Fields.Item("eventdate").Value) Then
> >
> >they> > 2057) & "<br>")
> > End If
> > %>
> >
> > <%= %> is nothing more than a shortcut for <%Response.Write()%>
> >
> > "Nathon Jones" <nathonjonesNOT@kirkmoor.com> wrote in message
> > news:d0jtpe$fqh$1@forums.macromedia.com...> > 2057)> >> Hi again,
> >>
> >> I have the following code on my page. I am trying to hide the
> >> "eventenddate" if it is the same as the eventdate.
> >>
> >> <%IF (rsDateMatch.Fields.Item("eventenddate").Value) <>
> >> "<%=(rsDateMatch.Fields.Item('eventdate').Value)%> " Then%>
> >> - <%= DoDateTime((rsDateMatch.Fields.Item("eventenddate" ).Value), 1,> > 2057)> >> %><br>
> >> <%End IF%>
> >>
> >> The above is giving me:
> >> Microsoft VBScript compilation (0x800A0409)
> >> Unterminated string constant
> >>
> >> So I tried:
> >>
> >> <%IF (rsDateMatch.Fields.Item("eventenddate").Value) <>
> >> "(rsDateMatch.Fields.Item('eventdate').Value)" Then%>
> >> - <%= DoDateTime((rsDateMatch.Fields.Item("eventenddate" ).Value), 1,> >> %><br>
> >> <%End IF%>
> >>
> >> But this is showing me both the start date and the end date, even ifwork> >> are the same.
> >>
> >> Hope you can help.
> >> Nath.
> >>
> >>
> >> "CMBergin" <NoHarvestForYou@NoSpam.org> wrote in message
> >> news:d0i7e5$1gh$1@forums.macromedia.com...
> >> > For Access, it's <>. Something else is tripping up the query.
> >> >
> >> >
> >> > "Nathon Jones" <nathonjonesNOT@kirkmoor.com> wrote in message
> >> > news:d0i6hb$o$1@forums.macromedia.com...
> >> >> Thank you CM,
> >> >>
> >> >> I think I am finally getting somewhere.
> >> >>
> >> >> What is the statement required for a "does not equal"?
> >> >>
> >> >> startdate (does not equal) enddate?
> >> >>
> >> >> I tried = = but that didn't work, then I tried <> but that didn'tNow()> >> >> either.
> >> >>
> >> >> Thanks again
> >> >> Nath.
> >> >>
> >> >> "CMBergin" <NoHarvestForYou@NoSpam.org> wrote in message
> >> >> news:d0i0sk$k3o$1@forums.macromedia.com...
> >> >> > Now returns date as well as time. If you just have a date in your
> >> >> > database,
> >> >> > then it's considered that day at midnight. So if you have >=worry> > place> >> > today
> >> >> > at
> >> >> > 3pm, then an even listed in the database as today (no time) takes> >> > at
> >> >> > midnight.
> >> >> > '3/6/2005' < '3/6/2005 15:00:00', so you don't get any events.
> >> >> >
> >> >> > My comparison goes in the opposite order, so you don't have toon> >> > about
> >> >> > it.
> >> >> > '3/6/2005 15:00:00' BETWEEN '3/6/2005' AND '3/7/3005' will work
> >> >> > since
> >> > 3pm
> >> >> > is
> >> >> > after midnight. You may have to add 1 to the end date dependingstart> > how> > put:> >> >> > you
> >> >> > want the display to work. Not adding 1 - event disappears on the
> >> >> > end
> >> >> > date.
> >> >> > Adding 1 - shows on the end date, but not after.
> >> >> >
> >> >> > "Nathon Jones" <nathonjonesNOT@kirkmoor.com> wrote in message
> >> >> > news:d0hva7$hek$1@forums.macromedia.com...
> >> >> >> Hi again CM!
> >> >> >>
> >> >> >> In Access, in order to show events that happen "today" I have to> >> >> >>
> >> >> >> WHERE eventdate >=Now()-1
> >> >> >>
> >> >> >> Do you know why that is? I notice, in your reply, that you have
> >> > excluded
> >> >> >> that.
> >> >> >>
> >> >> >> Thanks for all your help. Much appreciated.
> >> >> >> Nath.
> >> >> >>
> >> >> >> "CMBergin" <NoHarvestForYou@NoSpam.org> wrote in message
> >> >> >> news:d0htrt$f3i$1@forums.macromedia.com...
> >> >> >> > WHERE Now() BETWEEN eventStart AND eventEnd
> >> >> >> >
> >> >> >> > "Nathon Jones" <nathonjonesNOT@kirkmoor.com> wrote in message
> >> >> >> > news:d0hsi2$cs7$1@forums.macromedia.com...
> >> >> >> >> Hi,
> >> >> >> >>
> >> >> >> >> I need a little help with a SELECT statement.
> >> >> >> >>
> >> >> >> >> I have an events table in an Access db. The events have astart> >> > date
> >> >> > and
> >> >> >> > an
> >> >> >> >> end date.
> >> >> >> >>
> >> >> >> >> What statement do I need to show events that occur:
> >> >> >> >>
> >> >> >> >> i. on or after the event start date
> >> >> >> >> ii. on or before the event end date, but NOT prior to the>> >> >> > date
> >> >> >> >>
> >> >> >> >> In Access I have got a simple query that shows me everything
> >> >> >> >> that
> >> >> > happens
> >> >> >> > on
> >> >> >> >> or after "today" which looks like this:
> >> >> >> >>
> >> >> >> >> Field: eventstartdate
> >> >> >> >> Criteria: >=Now()-1
> >> >> >> >>
> >> >> >> >> I know it must be some kind of "between" command....!
> >> >> >> >> Any help would be greatly appreciated. Thanks.
> >> >> >> >>
> >> >> >> >> Nath.
> >> >> >> >>
> >> >> >> >>
> >> >> >> >
> >> >> >> >
> >> >> >>
> >> >> >>
> >> >> >
> >> >> >
> >> >>
> >> >>
> >> >
> >> >
> >>
> >>
> >
>
CMBergin Guest



Reply With Quote

