There is no easy transition from Nepalese to Gregorian. There are two ways to think about it:
- need to show the date of Nepalese
- need to be manipulated (for example, to find the difference between months, days, etc.).
The first one is simple - store as varchar
The second is not. If you want to know the difference between the two dates in Nepal, you can save the 2nd date as an equivalent in Gregorian font and use the datif / date (day) between them. However, the dateadd (month) will be useless for you here if you do not want to know the difference in 2 Nepalese dates in Gregorian date months - not often.
It seems that just storing in varchar and having a library for Nepalese dates, either in the interface or in the CLR, would be better.
This can help conversions have a fully materialized table of events in Nepal with a corresponding Gregorian date, so the layout will be
NepaliYear NepaliMonth NepaliDay Gregorian x 4 2 2014-21-23 etc
But I'm not sure if that would help many (Nepalese) date mathematicians go beyond conversion β and only if you need such a conversion in SQL Server.
EDIT
Comment by @pst
There is a reason VARCHAR prefers datetime. I suggested that the frequency, most of the activity - reading / writing Nepalese dates - which is stored and read as VARCHAR - there is no conversion. If and only when date math is required, it includes a library - in this case you call the conversion, and only if you need the equivalent in the Gregorian calendar at any time. If all you need is the math between NepaliDate / scalar or NepaliDate / NepaliDate - again, datetime is of no use - it cannot process day # 32 per month .
RichardTheKiwi
source share