Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
gagan
Starting Member
5 Posts |
Posted - 2003-08-01 : 14:50:16
|
Hi!,I am new to MS Access, i have to update a date column in tabletable_r ar_date date/time , defined as (general date)The Update queri i have written isDate ld_date_varUpdate table_r set ar_date = ld_date_var;comit;If my date variable has a date which i pick from a edit maskwith a mask of yyyy-mm-ddPlease, any help would be apperciated,Thanx,gagan |
|
X002548
Not Just a Number
15586 Posts |
Posted - 2003-08-01 : 15:55:50
|
How are you doing this? From a From, Query, Code?Are you accessing SQL Server or Access tables?What is the reason behind the update?Brett8-)SELECT POST=NewId() |
 |
|
gagan
Starting Member
5 Posts |
Posted - 2003-08-01 : 16:07:24
|
I am using powerbuilder front end and the backend is ms access database on my computer,usuall i work with Oracle where the regular update ststement can be embeded in the code and it works,like in Powerbuilder i writeexampleupdate table set date = to_date(date_variable,"mm-dd-yy");it works,but i am facing a lot of issues with Updating a date in MS access table.I can select fine from the tableThe reason for the update is to update column( ar_date) in a row in the table based on a where clause |
 |
|
X002548
Not Just a Number
15586 Posts |
Posted - 2003-08-01 : 16:18:52
|
TO_DATE is an Oracle function..Access is way more loseTryUPDATE Table1 SET col1 = '01-01-01';Brett8-)SELECT POST=NewId() |
 |
|
jsmith8858
Dr. Cross Join
7423 Posts |
Posted - 2003-08-01 : 16:44:17
|
Didn't we just go through this recently?In Access, surround dates with # and you are good to go. if you are using functions or variables, you don't even need that:update table set [date] = datevariableorupdate table set [date] = #1/1/2003#orupdate table set [date]= dateserial(2003,1,1)orupdate table set [date] = CDate("1/1/2003")hopefully some of those will help you out !- Jeff |
 |
|
gagan
Starting Member
5 Posts |
Posted - 2003-08-01 : 17:36:16
|
Thanx! guy's.I still have a problemI have t0 pass a variable when i set the date |
 |
|
gagan
Starting Member
5 Posts |
Posted - 2003-08-01 : 19:18:12
|
I figured it out, I wasn't putting : in front of the variableThanx to all for their timeGagan |
 |
|
|
|
|
|
|