Hi I have tried all kinds of formats and syntax I just can't get DateAdd to work with ODBC drivers...
System Windows NT PICWEB01 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) i586
ODBC library Win32
ODBCVER 0x0350
EG - [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
-
SELECT DATEADD ("dd", -2, '#1969-12-31 20:00:00#') AS NextCalibration FROM TblCalibItems;
- [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
-
SELECT DATEADD ("second", -2, '2022-02-02') AS NextCalibration FROM TblCalibItems;
etc...
5 8070 isladogs 460
Recognized Expert Moderator Contributor
Perhaps I've got this wrong but it appears that you are writing this code in Access
If so, try - SELECT DATEADD ("d", -2, "#1969-12-31 20:00:00#") AS NextCalibration FROM TblCalibItems;
and - SELECT DATEADD ("s", -2, "#2022-02-02#") AS NextCalibration FROM TblCalibItems;
isladogs 460
Recognized Expert Moderator Contributor
Thanks @zmbd
I approved the OP's post but for some reason was unable to get my own reply to appear!
DATEADD is not field of your table but a function, so try: - SELECT DateAdd("d", -2, "#1969-12-31 20:00:00#") AS NextCalibration FROM TblCalibItems;
Also, the correct arguments for DateAdd are required: DateAdd function.
NeoPa 32,569
Recognized Expert Moderator MVP
I would point you towards a few issues with your tests. Some have previously been identified / hinted at already.
Jet/ACE SQL allows both the appropriate SQL format quotes (') as well as the double-quotes ("). Mixing them, as you have, is probably also perfectly acceptable - even if it does look confused.
Acceptable values for the Interval parameter are listed in the article Cactus linked you to. Neither of "dd" nor "second" is in that list.
Some versions of SQL (T-SQL being an example) don't allow for date literal values and require a properly formatted date string (In such cases they require proper SQL quotes (') as delimiters). Access supports the same DateTime literals in SQL as it does in VBA. These require DateTime (Hash or Octothorp #) indicators and do not require string quotes, of any variety, around them. For more on what is acceptable for DateTimes see Literal DateTimes and Their Delimiters (#). You'll see there that your date formatting is otherwise optimal. Probably the best of the available standard SQL formats for them. Certainly the one with the least possibility of ambiguity.
I think, between us, we've explained every problem illustrated in your SQL code. I would just add, before I stop, my congratulations for formatting your question such that all the relevant information was available to us at the start.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: paul tomlinson |
last post by:
Hi folks - i've got a windows 2000 server (SP3) i've run the IIS
lockdown tool on it and set for dynamic websites - all the static
pages within the site work ok but an ASP section has been put in which
now keeps giving me the error below :
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
General error Unable to open
registry key 'Temporary (volatile) Jet DSN for process 0x404 Thread
0x6ac DBC 0xbd7014 Jet'.
|
by: M P |
last post by:
What does this mean? I am accessing an ASP page that queries Access Database
thru fileDSN. I'm using IIS 5.0 Win2K SP4
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
General error Unable to open
registry key 'Temporary (volatile) Jet DSN for process 0x444 Thread 0xfe4
DBC 0x5200024 Jet'.
|
by: john_20_28_2000 |
last post by:
They are corrupt. I cannot get the odbc driver applet for sql server
to open when I click add and I cannot configure any existing ones. And
the usage of the drivers fail.
Other ODBC drivers work.
Does anyone know how to reinstall the SQL Server set of ODBC drivers?
MDAC wouldn't install, said it was already at current level.
Thanks for any ideas.
|
by: MLH |
last post by:
I'm running XP. Is it required that a given ODBC driver be
selected or set somehow as a default driver? Look at this...
Here's the error: Error: ODBC call failed...
Datasource not found and no default ODBC driver specified.
I think I can work my way around the Datasource, but the
default driver thing (#0) - dunno?
|
by: Mark |
last post by:
Hi all,
I was wondering if anybody knew if it was at all possible to install
old odbc drivers (approx ver 3.5) instead of the standard windows XP
(ver 4.0)? The reason I need to use 3.5 is because a piece of old
software is being used needs to use the older drivers because of its
age.
Ive tried to manually copy older drivers (win98)and replace existing
drivers but unfortunately windows automatically restores the orginal
files on...
| |
by: hugh welford |
last post by:
Hi - using XP pro with IIS to develop offline asp data access site.
Suddenly, my DSNs and odbc drivers have disappeared - the only thing I can
think of is that an XP auto update has done this in some way.
Can anyone tell me how to get hold of and re-instal odbc drivers to allow
me to connect with ACCESS data bases.
Thanks Hugh
|
by: pericpero |
last post by:
Hi
There seem to be a number of posts already with this error message but none of them have helped me ...
I am trying to execute some dynamic SQL from an ASP form to update or delete from a table and I get the following output:-
==
SQL=Update StockItemMaterials set =3 WHERE ="P0855" AND ="GOGGW"
Microsoft OLE DB Provider for ODBC Drivers error '80040e10'
|
by: ToddAndMargo |
last post by:
Hi All,
Okay. I give up. I need to install the latest ODBC
drivers that work with Microsoft's SQL server 2000.
(I am write a Lotus Approach front end to an existing
sql2000 database.)
I have looked all over Microsoft's download web site,
but no joy (I may not have know what to search for or
what the answer that came back meant.)
|
by: jimbo905 |
last post by:
My secretaries HD crashed - bummer. I got a new HD running XP pro with SP3. I have installed 8i client using the OUI (at first I had to rename symcjit.dll to symcjit_old.dll). All the components appeared to install.
I used OUI to install the 8i ODBC drivers but when I go to
ADMINISTRATIVE TOOLS/DATA SOURCES >>>SYSTEM DNS tab
and try to add the 8i ODBC driver set it does not appear in the list
Using Oracle's KB I found a list of all...
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
| |
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |