The description would seem to suggest that the answer is infact correct.
You want 1 day (not counting public holidays) notice of an appointment for the 2 jan 2003. that means you haveto give notice today doesnt it?
Main Topics
Browse All TopicsI have a somewhat complex select, which is supposed to return appointments that need notified bewteen today and the appointment date. Sounds simple, but, the appointments have a notification date...which depends on how many days in advance the client wants notified. On top of that, holidays and weekends add to the days in advance.
Everything seemed to be working fine this month, Christmas gave no problems, now we are around a new year and I'm having problems.....
Appointment set for 1/2/2004 where the client wants notified 1 day in advance, which happens to be 1/1/2004 which is a holiday...so the date moves to 12/31/2003 which is today.
My WHERE
.......
AND
(CONVERT(varchar(25), GETDATE(), 101)
BETWEEN
CONVERT(varchar(25), dbo.fn_Confirm_Date(dbo.v_
dbo.Client_Confirmation_Co
AND
CONVERT(varchar(25), dbo.v_Appointments_Active.
Which I see as being:
Is 12/31/2003 Between 12/31/2003 and 1/2/2004
Anyone have any ideas why the new year seems to give me a problem?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
I don't think my answer was wrong in the first place, other than the fact it is comparing strings instead of dates
so I need to figure out how to keep the dates I have, and not worry about the time part
12/31/2003 9:00am BETWEEN 12/31/2003 10:00am AND 1/2/2004 10:00am
See what I mean? If I ran my app at 9am, the 10am appointment would not be seen
If you dont want time to be a part of it then compare
floor(convert(float,getdat
between
floor(convert(float,dbo.fn
dbo.Client_Confirmation_Co
and
floor(convert(float,dbo.v_
explanation:
datetime fields are comprised of two integers which can be treat as a float where the number before the . is the date and the number after the . is the time.
so by making it an integer you can compare effectively day numbers.
Or you could of course convert the varchars back to dates again but its messy
Business Accounts
Answer for Membership
by: acampomaPosted on 2003-12-31 at 08:23:18ID: 10022006
Because you are converting you dates to varchar.you must keep them as dates in your where clause, otherwise, they have no real value other than a string