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.

 All Forums
 Other Forums
 MS Access
 Dates from SQL to access

Author  Topic 

rookie_sql
Constraint Violating Yak Guru

443 Posts

Posted - 2007-04-05 : 06:57:42
Hi i want to bring my date field from SQL table into my access db table column but i don't want the time included in the field

my access column is of date\time datatype

Here is what i have so far am i on the right path ?
i don't know what to put into the ##### i;ve tried ddmmyy

UPDATE tbl_test
SET tbl_test.[NEW_WORK_DT] = Format([WORK_DT],"######")

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-04-05 : 07:14:50
[code]UPDATE tbl_test
SET tbl_test.[NEW_WORK_DT] = Format([WORK_DT],"dd/mm/yyyy")[/code]

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2007-04-05 : 08:25:19
I just have to ask:

Did it occur to you to simply hit F1 or pull down the "Help" menu to see what the ms access help tells you about using Format? Or do a simple google for "Access format function" (the very first result explains things perfectly) ?

I'm not trying to be a jerk, and if I am I apologize, I am just honestly extremely curious ... it seems to much easier to simply read the help file or do a quick google when you are stuck and the answer is easy to look up (i.e., how the arguments in a function work) instead of posting a question on a forum like this ...... I just wonder why so many people simply don't do the obvious and simple thing and instead prefer to log into a forum, create a new post, type in a question, and wait for a response .... it just seems easier to simply look it up I guess. Maybe it's just me.



- Jeff
http://weblogs.sqlteam.com/JeffS
Go to Top of Page

rookie_sql
Constraint Violating Yak Guru

443 Posts

Posted - 2007-04-05 : 09:53:43
I did and thats where i got most of my query from but when i tried to run it like it says on this help i was getting an error


= Format(Now(), "hh:mm AMPM") If the current time is 5:04:23 in the afternoon, the expression returns 05:04 PM.
= Format(Now(), "Long Time") Returns current time in the system-defined long time format.
= Format(Now(), "h:m:s") If the current time is 8:04:23, the expression returns 8:4:23.
= Format(Date(), "dddd, mmm d yyyy") If the current date is 11/14/2003, the expression returns "Friday, Nov 14 2003".
Go to Top of Page

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2007-04-05 : 10:23:41
I guess in this case the help could be more clear ... I thought there was a section on custom date formats somewhere there.

- Jeff
http://weblogs.sqlteam.com/JeffS
Go to Top of Page
   

- Advertisement -