Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-27-2013, 10:53 AM
jassie jassie is offline excel 2010 to format a date Windows 7 64bit excel 2010 to format a date Office 2007
Novice
excel 2010 to format a date
 
Join Date: Feb 2012
Posts: 18
jassie is on a distinguished road
Default excel 2010 to format a date

In excel 2010, I am placing the following syntax in each row of the excel spreadsheet.
= "Update trans set c_date = 'DATEVALUE("&P1&")' where trans_ID = '"&D1&"'"
I want to obtain the trans_id and c_date values from each applicable column. I am obtaining the
trans_id value with no problem. However I am having a problem obtaining the C_date value in the
format I need it to be. I would like the date to look like the following:
2013-01-29 17:04:00.207. This format is yyyy-mm-dd hh:mm:ss:000. The date can be in a short date format.
I originally obtained the value in the C_date column from a sql server 2008 database.
Thus can you tell me what I need to do obtain the C_date value in the format I need?
Reply With Quote
  #2  
Old 03-28-2013, 02:33 AM
macropod's Avatar
macropod macropod is offline excel 2010 to format a date Windows 7 64bit excel 2010 to format a date Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi Jassie,

Your second line is quite unclear. Can you attach a document to a post with some representative data (delete anything sensitive)? You do this via the paperclip symbol on the 'Go Advanced' tab.

FWIW, to coerce a number into a date/time string, you could use a formula like:
=TEXT(A1,"YYYY-MM-DD hh:mm:ss")
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to create microsoft Excel 2007 and 2010 File in .xlsx format ipacesetters Excel 1 12-16-2019 05:13 PM
excel 2010 to format a date MS Query date format remigio Word 3 08-21-2012 10:54 PM
date format gsrikanth Excel 1 12-28-2011 05:06 AM
excel 2010 to format a date Mail merge will not format date field generated by Excel IF statement borntorun75 Mail Merge 3 12-16-2011 06:28 AM
Excel 2010 Format cells to use as Gantt or Plan Kizzie Excel 0 12-13-2011 02:31 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:38 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft