hi all
i know this function
format(date,"y")
output= 46
but how can i learn 46 to date?
format(46,"dd.mm.yyyy") = 14.02.1900
but i want for this year (2010)
i dont want add any number to 46,
40178 = 01.01.2010 but i dont want this
i want learn for this year
example: for 2015 i want use same function, how can i do it?
Sorry for my bad english.
please help
convert integer to dateconvert integer to date
Page 1 of 1
8 Replies - 3212 Views - Last Post: 16 February 2010 - 08:29 AM
Replies To: convert integer to date
#2
Re: convert integer to date
Posted 15 February 2010 - 09:07 AM
do you try using CDate
Function CDate(Expression) As Date
Member of VBA.Conversion
Converts an expression to a Date
Function CDate(Expression) As Date
Member of VBA.Conversion
Converts an expression to a Date
This post has been edited by NoBrain: 15 February 2010 - 12:10 PM
#3
Re: convert integer to date
Posted 15 February 2010 - 07:27 PM
Quote
y Display the day of the year as a number (1 – 366).
So you are not returning the year with that code but returning the day of the year...
So what you need to do is use either of these...
Quote
yy Display the year as a 2-digit number (00 – 99).
yyyy Display the year as a 4-digit number (100 – 9999).
yyyy Display the year as a 4-digit number (100 – 9999).
in your format function...
and you can find this information in help under the see also link > User-Defined Date/Time Formats (Format Function)
Good Luck
#4 Guest_Guest*
Re: convert integer to date
Posted 16 February 2010 - 02:42 AM
i try cdate.
i search user defined date format but i cant find,
its really important for me.
i search user defined date format but i cant find,
its really important for me.
#5
Re: convert integer to date
Posted 16 February 2010 - 02:52 AM
well we rly dont understand what you want (me for sure) you want to cut the year only from a date or what. if so use format(dDate,"yyyy") if dDate contain "16.02.2010" then format() function will return 2010. but if you take the year only how do you think the compiler will know the whole date?
#6
Re: convert integer to date
Posted 16 February 2010 - 06:32 AM
Type in format and press F1, click on see also, when dialog pops up, select appropriate title I gave you and select ok.
Good Luck
Good Luck
#7 Guest_pojeck*
Re: convert integer to date
Posted 16 February 2010 - 07:20 AM
NoBrain, on 16 February 2010 - 01:52 AM, said:
well we rly dont understand what you want (me for sure) you want to cut the year only from a date or what. if so use format(dDate,"yyyy") if dDate contain "16.02.2010" then format() function will return 2010. but if you take the year only how do you think the compiler will know the whole date?
hi
format(date,"y") = 47 for today
i want a function when i write 47
function is return me 16.02.2010
example format(47,"dd.mm.yyyy") = 16.02.1900
but i want this function for this year,
function(46,"dd.mm.yyyy") = 16.02.2010
but some times february have 29 days
if i use 1900 february is 28 and always same.
i want a function, number to date for active year..
I hope i explain my problem.
Thank u so much
#8
Re: convert integer to date
Posted 16 February 2010 - 07:41 AM
#9 Guest_Adil Kara*
Re: convert integer to date
Posted 16 February 2010 - 08:29 AM
Page 1 of 1
|
|

New Topic/Question
Reply
MultiQuote







|