close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Help with returning records based on date using now() or curdate()

Thread began 7/13/2017 4:10 pm by iain331081 | Last modified 7/13/2017 7:09 pm by Ray Borduin | 208 views | 2 replies |

iain331081

Help with returning records based on date using now() or curdate()

Hopefully this is a quick one, but I am getting some odd results trying to return records where a date field is between the current date and 7 days from the current date.

I have tried using:

WHERE trade_users.Follow_up_date >= (CURDATE() - INTERVAL 7 DAY)

or

WHERE trade_users.Follow_up_date >= NOW() - INTERVAL 7 DAY

Playing around with it, its doing something - I tried changing the range til I spotted it do something different.

So for example:

WHERE trade_users.Follow_up_date >= (CURDATE() - INTERVAL 70 DAY)

Returns records from 9 May 2017 to 12 November 2017, which is odd as it covers more than 70 days, with dates in both the past and the future.

If I just have WHERE trade_users.Follow_up_date >= NOW() it seems OK, ie returns the five records with a follow up date in the future.

Have attached the page below.

Thank you.

Sign in to reply to this post

iain331081

I might have it working with:

WHERE trade_users.Follow_up_date >= NOW()
AND trade_users.Follow_up_date < DATE_ADD(NOW(), INTERVAL + 7 DAY)

Does that look right?

Sign in to reply to this post

Ray BorduinWebAssist

Yes I think that would work.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...