473,397 Members | 1,949 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

In query, get a value from last year's end quarterly date.

294 256MB
Hi, all.

I'm attempting to compare values from this year's ending quarter, and the previous years.

In the Criteria for the query, I tried:

DateAdd("q",-4,Date)

Which didn't work. Any ideas?
Dec 2 '13 #1

✓ answered by Seth Schrock

In SQL, the date function is used like this: Date(). So your criteria would be
Expand|Select|Wrap|Line Numbers
  1. DateAdd("q", -4, Date())

4 1686
Seth Schrock
2,965 Expert 2GB
In SQL, the date function is used like this: Date(). So your criteria would be
Expand|Select|Wrap|Line Numbers
  1. DateAdd("q", -4, Date())
Dec 2 '13 #2
mcupito
294 256MB
Thanks again, Seth! It seems I must have seen 'Date' somewhere and had that on my mind rather than 'Date()'
Dec 2 '13 #3
Seth Schrock
2,965 Expert 2GB
In VBA, you would just enter Date so that may have been where you have seen it. It works the same with the Now, Day, Month and Year functions. VBA leaves out the parenthesis and SQL includes them.
Dec 2 '13 #4
mcupito
294 256MB
Thanks, Seth! You are correct - that's where I saw it.
Dec 3 '13 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Ken | last post by:
I wrote a function to use in queries that takes a date and adds or subtracts a certain length time and then returns the new value. There are times when my function needs to return Null values. ...
2
by: Terry | last post by:
I have a database that I would like to query for a specific date range. I want to create a report based on this query that will pull any records from the last 7 days. Is this possible? Can...
0
by: trishbarker | last post by:
I've created a simple select query in Microsoft Access wherein I'm searching all records based on the "Final Payment Due Date". The Final Payment Due Date is a calculated expression based on two...
1
by: Gidi | last post by:
Hi, How can I get the value of a selected date (after i changed the date) ? Thanks, Gidi.
4
by: MCLR | last post by:
Good day to all: I found your website a couple of days ago as I was searching for resources that can help within my particular problem in writing a script for an Access Query. The issue is to...
2
oszapped
by: oszapped | last post by:
I am new to creating SQL queries and need some help. I am trying to query from three tables. 1 - A table with a list of Drawings (DRAWINGS) 2 - A table with the Revision history of the Drawings...
2
by: Supermansteel | last post by:
Our team does numerous tests each month. Each person can run a report to automatically tally up all the results for the quarter. I have then created a Form specifically to enter our Analysis for the...
5
daJunkCollector
by: daJunkCollector | last post by:
Hey, I have a string variable, $s_dateboxEffectiveStartDate I need to add - two years minus one day - to this variable. Could anyone offer any advise? function...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.