Solved

Please Help with...How to subtract datefield from Date()

Posted on 2006-11-30
1
206 Views
Last Modified: 2013-12-24
I have been trying to write a query to pull from a field called date_open - Date().  What I want to see is when the date_open is over 21 days due I want the query to show just those records.  The other criterial are they need to be open or pending only. The below script is what I have worked with for the past 2 days with no avail.  Can someone please just look at it and lead me in the right direction.  Thanks in advance for all your help.

The error is listed also below.

SELECT ticket_Table1.date_open, ticket_Table1.tkt_id, ticket_Table1.service_tkt_status

FROM ticket_Table1

WHERE ((date_open<[# & Date()-21 & #])) AND ((ticket_Table1.service_tkt_status)='Open' Or (ticket_Table1.service_tkt_status)='Pending Approval')
ORDER BY ticket_Table1.tkt_id DESC;

I looked this error up and I made sure all the fields are spelled the same:

Database Results Error
Description: No value given for one or more required parameters.
Number: -2147217904 (0x80040E10)
Source: Microsoft JET Database Engine
0
Comment
Question by:bburden
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 16

Accepted Solution

by:
CWS (haripriya) earned 225 total points
ID: 18052305
SELECT ticket_Table1.date_open, ticket_Table1.tkt_id, ticket_Table1.service_tkt_status

FROM ticket_Table1

WHERE (ticket_Table1.date_open< Date()-21 ) AND ((ticket_Table1.service_tkt_status)='Open' Or (ticket_Table1.service_tkt_status)='Pending Approval')
ORDER BY ticket_Table1.tkt_id DESC;

0

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When deciding to adopt any help desk solutions many factors should be explored before taking decisions. This will change from business to another but in general there are some kind of rule of thumb. Here are some quick tips: Do we need only ticket…
Introduction In this tutorial, I'll explain how to create an animated progress meter in a wireframe prototype developed using Axure RP 7.0 - a leading prototyping tool for designing web sites and software. (For more information about Axure and gett…
The purpose of this video is to demonstrate how to create a Printer Friendly PDF on a WordPress Page. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome Screenshot” Google Chrome Extension, and SmallPDF.com Log…
The purpose of this video is to demonstrate how to manually back up a WordPress Database. This will be demonstrated using a Windows 8 PC. The Host used will be IPage.com Log into your Hosting account. IPage will be used for demonstration : Locat…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question