tnx to all ho have answered my query from the past.
again po i'll ask your magnificient kind of thingnking.
my query statement was like this " SELECT cast(MATDATE as DOUBLE) as 'MATURITY DATE' FROM LNACC"
ang laman po kasi ng MATDATE field ko ay nk number (i.e. 38965 ay equivalent sa Mach 12, 2009(assume lang po itong value nya))
paano ko po ito maidisplay sa DATAGRIDVIEW.
or kahit po sa SELECT STATEMENT nlang po nya convert kung pwede.
tnx. po
Hello Zirc.net, here's a sample code for your problem,I hope this helps...
DECLARE @DateValue datetimeSET @DateValue = CONVERT(datetime,39452);-- Jan 07, 2008SELECT CONVERT(varchar,@DateValue,107)-- January 7, 2008SELECT DATENAME(month,@DateValue) + ' ' + CONVERT(varchar,DAY(@DateValue)) + ', ' + CONVERT(varchar,YEAR(@DateValue))
tnx for the reply sir.
sorry i didnt make my query clear
i'm accesing foxpro free table like this...
ACC CHD MATDATE ---- fields
123 4 39865 ----- field value
234 5 38659
325 6 32651
i use DATASETS to store my query ,my query goes on oledbadpater("SELECT ACC,CHD,MATDATE FROM LNACC",MYCON)
then i use the FILL method. and then set is as the DATA SOURCE of my DATAGRIDVIEW.
what i want is how i can display the MATDATE value into DATE Format instead the 39865,38659 eth.
thnx
hi zirc.net,
I don't know how to do the proper query in foxpro but i do know how you can create a workaround for this issue in code. One of the things that always do is I try not to code against a dataset. Every time i retrive my data I always put it on it's own object(class) and build my processing logic from there. You could then create a DateTime property that would correspond to your double value by doing DateTime conversion. You can the use DateTime.FromOADate() to convert your numeric value to DateTime.
HTH