I have a column date with 'Date/Time' type which holds values like this
8/4/2009 for the 4th day of the 8th month of 2009, due to some bug many records write instead 8/4/4009 so I want for those record to put the write date. The whole thing is for a asp script so for there I could easily write a SQL query like -
update DailySnapStocks set Date='4/8/2009' where Date='4/8/4009' and Symbol='FTSE'
-
which didn't work but is pretty much what I want to do any help?
9 1968
Without knowing what the error message is, I would say try this - update DailySnapStocks set Date=#4/8/2009# where Date=#4/8/4009# and Symbol='FTSE'
If this is not it, please post the error, or tell us if there isn't one.
-AJ
Tried -
update DailySnapStocks set Date=#4/8/2009# where Date=#4/8/4009# and Symbol='FTSE'
-
got a "Syntax error in UPDATE statement" popoup and when I press help I see
"Syntax error in UPDATE statement. (Error 3144) "
OK try this one ... -
update DailySnapStocks
-
set [Date]=#4/8/2009#
-
where [Date]='4/8/4009'
-
and Symbol='FTSE'
-
Date is a reserved word in Access and should not be used on its own as a field name. Using the square brackets will help with this but I would recommend changing the field name.
Remember that Date can sometimes be tricky as it's also a function.
Try this one out: - UPDATE DailySnapStocks SET DailySnapStocks.[Date] =#4/8/2009#
-
WHERE (((DailySnapStocks.[Date] = #4/8/4009#) AND ((DailySnapStocks.Symbol)='FTSE'));
This is a bit more wordy, since I built it in the Query Editor.
EDIT: Looks like we posted on top of each other, Mary!
Great minds think alike ... and all that :D
Well...msquared's solution got me an 3464 Error
topher23's Worked (with removing an extra parenthesis),
a new (better) new possible solution which saw and deals with all updates at once is
update DailySnapStocks set date=DATEADD(yyyy, 1000, DailySnapStocks.date) where Symbol='FTSE' and date like '%40%'
This is MSSQL code which worked perfect in SQL server '08 but in Access
made like this
update DailySnapStocks set date=DATEADD(yyyy, 1000, [Date]) where Symbol='FTSE' and date like '*40*'
got a 3144 Error any ideas?
Try this ... -
update DailySnapStocks set date=DATEADD("yyyy", -2000, [Date]) where Symbol='FTSE' and date like '*40*'
-
Worked like this
update DailySnapStocks set [date]=DATEADD("yyyy", -2000, [Date]) where Symbol='FTSE' and [date] like '*40*'
At last I can continue, you cannot imagine how many hours I spent wondering why it is not working (I thought that the SQL view was identical to the mssql which I worked in sql studio since they are both from microsoft...)
Anyway thanks a lot both of you for your quick replys
Glad you got it working. Unfortunately the syntax in Access is quite different to MS SQL outside of the basics of course. You'll get there eventually with trial and error.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Tim Davidge |
last post by:
Hi folks, been a while since I have posted a plea for help and I think I
have forgotten everything I learnt from the helpful contributors to this
newsgroup, that said however :
I'm trying to...
|
by: Tony |
last post by:
Hey guys,
I use Google Groups quite a bit as it is an enormous wealth of
information, and now I need some help. I have created a query using
parameters to capture a range of date, the date is...
|
by: Lyn |
last post by:
I am trying to get my head around the concept of default, special or empty
values that appear in Access VBA, depending on data type. The Access Help
is not much (help), and the manual that I have...
|
by: John Feeley |
last post by:
am tring to add a number of years to a dob. im doing this by adding my
date+years*365.26 I get a string of numbers. I then convert the number in
the next column to actual date again. I'm getting...
|
by: jamesyreid |
last post by:
Hi,
I'm really sorry to post this as I know it must have been asked
countless times before, but I can't find an answer anywhere.
Does anyone have a snippet of JavaScript code I could borrow...
|
by: Alan Mailer |
last post by:
A project I'm working on is going to use VB6 as a front end. The back
end is going to be pre-existing MS Access 2002 database tables which
already have records in them *but do not have any...
|
by: gre1unix |
last post by:
I am new to VBA Access. I create "mytable" with 2 columns from existing main table by giving start date and end date.
Given below is mytable.
First column: dt( date hr:min:sec format )
Second...
|
by: Sigmazen |
last post by:
Hi
I am looking in to utilising the new functionality of DPSIs on zOS UDB
(DB2 v8), but I have a question regarding the following scenario.
- The first table is an Account table whose columns...
|
by: Catalyst159 |
last post by:
I have a form which is used to calculate residential Floor Area Ratio (FAR). The form is structured into seven parts as follows:
Part A: Maximum FAR and Floor Area:
Part B: Gross Floor Area of...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
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...
|
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...
|
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...
|
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,...
|
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...
|
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...
| |