Ask a Question related to ASP, Design and Development.
-
Tipple #1
dateAdd and datePart return 13, 14, 15 instead of 1, 2, 3
I'm trying to increment between the end of lunch and the end of the day. The
code below is returning a datePart of 13 instead of 1 (for 1:00:00 PM) and
14 instead of 2:00:00 PM etc..
If response.write just counter2 I get a real hour.
How can I return the actual hour datePart?
lunchStart = "12:00:00 PM"
lunchEnd = "1:00:00 PM"
dayEnd = "5:00:00 PM"
counter2 = cdate(lunchEnd)
while counter2 >= cdate(lunchEnd) AND counter2 <= cdate(dayEnd)
response.write datePart("h",counter2)
counter2 = dateAdd("h",1,counter2)
wend
Thanks
Tipple Guest
-
DatePart, 24-hour clock
Does anyone know how to display a DatePart hour in 24-hour clock format? I have extracted the hour from an form field (ODBC date), but the... -
How to SELECT DatePart as a new Variable
I need to select the date from a dateTime field as its own variable... for grouping later in the output.<CFQUERY NAME="GetSessions"... -
dateadd()
Hi! I need to add 1 day to a specific date. The date have is stored in a variable called "DateOld". The value of the variable have this syntax:... -
DatePart query
Hi Group, i am trying to use the DatePart function on my SQL2000 database. I have a table called visitors with a field called DateTimeEntrance... -
Using DatePart and DateDiff together in a query
Does any one know how I would go about using DatePArt and DateDiff in the same query for the same field? For example, I need to get the amount of... -
Ray at #2
Re: dateAdd and datePart return 13, 14, 15 instead of 1, 2, 3
I'd imagine this is to be expected, since if it returned 5 instead of 17,
that would be inaccurate, in my opinion. You can subtract 12 if the number
is greater than 12.
h = datepart("h", counter)
If n > 12 then h = h - 12
Ray at work
"Tipple" <email@not-an-email-address.com> wrote in message
news:Oc0GrWzkDHA.3316@tk2msftngp13.phx.gbl...The>
> I'm trying to increment between the end of lunch and the end of the day.> code below is returning a datePart of 13 instead of 1 (for 1:00:00 PM) and
> 14 instead of 2:00:00 PM etc..
>
> If response.write just counter2 I get a real hour.
> How can I return the actual hour datePart?
>
>
> lunchStart = "12:00:00 PM"
> lunchEnd = "1:00:00 PM"
> dayEnd = "5:00:00 PM"
> counter2 = cdate(lunchEnd)
>
> while counter2 >= cdate(lunchEnd) AND counter2 <= cdate(dayEnd)
> response.write datePart("h",counter2)
> counter2 = dateAdd("h",1,counter2)
> wend
>
>
>
> Thanks
>
>
>
>
>
Ray at Guest
-
Tipple #3
Re: dateAdd and datePart return 13, 14, 15 instead of 1, 2, 3
Thank you.
"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
news:eSfOVgzkDHA.3320@tk2msftngp13.phx.gbl...number> I'd imagine this is to be expected, since if it returned 5 instead of 17,
> that would be inaccurate, in my opinion. You can subtract 12 if theand> is greater than 12.
>
> h = datepart("h", counter)
> If n > 12 then h = h - 12
>
> Ray at work
>
> "Tipple" <email@not-an-email-address.com> wrote in message
> news:Oc0GrWzkDHA.3316@tk2msftngp13.phx.gbl...> The> >
> > I'm trying to increment between the end of lunch and the end of the day.> > code below is returning a datePart of 13 instead of 1 (for 1:00:00 PM)>> > 14 instead of 2:00:00 PM etc..
> >
> > If response.write just counter2 I get a real hour.
> > How can I return the actual hour datePart?
> >
> >
> > lunchStart = "12:00:00 PM"
> > lunchEnd = "1:00:00 PM"
> > dayEnd = "5:00:00 PM"
> > counter2 = cdate(lunchEnd)
> >
> > while counter2 >= cdate(lunchEnd) AND counter2 <= cdate(dayEnd)
> > response.write datePart("h",counter2)
> > counter2 = dateAdd("h",1,counter2)
> > wend
> >
> >
> >
> > Thanks
> >
> >
> >
> >
> >
>
Tipple Guest



Reply With Quote

