Connect with Expertise | Find Experts, Get Answers, Share Insights

Is it possible to make a date datatype accept 13 as a month and 30 for all months?

 
Join Date: Jan 2010
Posts: 14
#1: Feb 3 '10
I am in ethiopia and we have 13 monthes. 12 of them with 30 days each and 13th month with 5 or 6 days. I want to sort my data by date using the bindingsource sort method. But to do that I need to set my date field a date data type. When i set the datatype to date, i can't enter some values like 13 for the month value and 30 for day value of 2nd month.

What I want is just to make my application accept 13 as a month and 30 as a day for all monthes, so that i can sort my data by date. Is it possible to do so by setting culture for my application or by some other means? please help?
best answer - posted by yarbrough40
you could add a separate column in your datatable to account for the extra epagomenal days... then sort your data by both columns. for instance: here would be a sample table sorted descending first by Column1 then by Column2:

RegDate----------------EpaDate

12/30/09--------------- 1/5/2010
12/30/09----------------1/4/2010
12/30/09----------------1/3/2010
12/30/09----------------1/2/2010
12/30/09----------------1/1/2010
12/30/09------------------NULL
12/29/09------------------NULL
12/28/09------------------NULL

etc...


so in effect any row you have where RegDate = '12/30'
and EpDate Is Not NULL is your extra month

yarbrough40's Avatar
C
 
Join Date: Jun 2009
Posts: 161
#2: Feb 3 '10

re: Is it possible to make a date datatype accept 13 as a month and 30 for all months?


you could add a separate column in your datatable to account for the extra epagomenal days... then sort your data by both columns. for instance: here would be a sample table sorted descending first by Column1 then by Column2:

RegDate----------------EpaDate

12/30/09--------------- 1/5/2010
12/30/09----------------1/4/2010
12/30/09----------------1/3/2010
12/30/09----------------1/2/2010
12/30/09----------------1/1/2010
12/30/09------------------NULL
12/29/09------------------NULL
12/28/09------------------NULL

etc...


so in effect any row you have where RegDate = '12/30'
and EpDate Is Not NULL is your extra month
 
Join Date: Jan 2010
Posts: 14
#3: Feb 4 '10

re: Is it possible to make a date datatype accept 13 as a month and 30 for all months?


I can't get your idea, would you please make it a bit clear?
 
Join Date: Jan 2010
Posts: 14
#4: Feb 4 '10

re: Is it possible to make a date datatype accept 13 as a month and 30 for all months?


I can't get your idea, would you please make it a bit clear?
 
Join Date: Jan 2010
Posts: 14
#5: Feb 4 '10

re: Is it possible to make a date datatype accept 13 as a month and 30 for all months?


how can i calculate the epagomenal dates by code
 
Join Date: Sep 2008
Posts: 11
#6: Feb 4 '10

re: Is it possible to make a date datatype accept 13 as a month and 30 for all months?


Why not just track what day of the year it is and use offsets to discover what day of what month you are in then report that back to the system that is interested?
 
Join Date: Jan 2010
Posts: 14
#7: Feb 4 '10

re: Is it possible to make a date datatype accept 13 as a month and 30 for all months?


Thanks I got it i will try it that way!
Reply

Tags
13monthes, calendar, ethiopia