Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Help   Contact   Merch   Join   Order   Logon   Forums   
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Solar Hijri Dates
Habib Samander 
   
5 years ago
How to Convert Gregorian Date to Solar Hijri Date and Vise Versa and Create Solar Hijri Date Manually in Access?

Hello, Dear Richard Rost
There are two types of dates in MS Access Gregorian and Lunar Hijri, but there is no Solar Hijri which is Excel and not in Access. Will it be added to Access in the future? How can I convert Gregorian Date to Solar Hijri?
I Tried to convert it with DateDiff function, but it doesnt work, because the number of days of months differ in the two dates.
I also tried to make the Solar Date from number field like 14000110 and formatted it like 1400/01/10.
But this is also difficult to write accurately, because if a 0 in a month or a day less the than 10 is forgotten like 1400/1/1 it cannot be changed to 1400/01/01. In this case the number 140011 and 14000101 are different and it makes problems.
Is there any way to convert it properly or is there any way to create the Solar Date manually and which should be entered, formatted and handled easily? For example, if 140011 is entered, zero should be added to the month and day if they are less than 10, like 140011 should be changed to 14000101 and should be formatted like 1400/01/01.
Thanks
Habib Samander
Gold Member
From Kabul, Afghanistan
Richard Rost  @Reply  
          
5 years ago
I would love to help you with this, but I know absolutely nothing about Hijri or Solar dates. I would have to first learn about them and then translate that into Access, which I'm sure I could do... but I don't have the time right now. If you have a resource you can direct me to that can teach me how these dates work, then maybe I could put something together for you.
Habib Samander OP  @Reply  
   
5 years ago
https://en.wikipedia.org/wiki/Solar_Hijri_calendar

https://communities.sas.com/t5/General-SAS-Programming/How-to-convert-dates-from-Gregorian-to-Solar-Hijri-calendar/td-p/410224
Richard Rost  @Reply  
          
5 years ago
OK, that's a lot of information to digest. I'll add it to my TO DO list and when I get some extra time, I'll look through it more. In the mean time, you might find a faster solution with a search of the Google machine. I'd try "vba convert gregorian to hijri" or something like that. I'm sure someone else has done it already. Why re-invent the wheel? :)
Adam Schwanz  @Reply  
           
5 years ago
You're looking to convert from a Gregorian formatted date to Solar formatted correct?

You should be able to just create the result you want.
If I have two fields. One called MyDate (Where I put in the date like 1/1/1400) and one called Result I can use this code to return 19880101

Private Sub MyDate_AfterUpdate()
    Dim D
    Dim M
    Dim Y
    D = Day(MyDate)
    M = Month(MyDate)
    Y = Year(MyDate)
    
    If D < 10 Then
    D = "0" & D
    End If
    
    If M < 10 Then
    M = "0" & M
    End If

    Result = Y & M & D
    
End Sub
Adam Schwanz  @Reply  
           
5 years ago
sorry 14000101 is the result LOL
Habib Samander OP  @Reply  
   
5 years ago
Ok, I will try to find an easy solution to it and give you, but be careful that I want Solar Hijri date which is used in Iran and Afghanistan and may be in some other countries, not Lunar Hijri (also called Islamic Hijri) date, because Lunar Hijri is already supported by Access.
Habib Samander OP  @Reply  
   
5 years ago
One thing that I wrote incorrect in the title of this question is Lunar Hirjri Date which should be Solar Hijri, because my question and problem is  with Solar Hijri Date, not Lunar Hijri Date.
I hope you change Lunar Hijri to Solar Hijri in the title of this question.
the title should be updated to this
How to Convert Gregorian Date to Solar Hijri Date and Vise Versa and Create Solar Date Manually in Access?
Juan C Rivera  @Reply  
            
5 years ago
not sure if this will help
Year Gregorian = Year Muslim � 0.97 + 622. If you want to convert a Gregorian date to a Muslim date, you need to subtract 622 from the original year and then multiply by 1.03: Year Muslim = (Year Gregorian� 622) � 1.03
Might be able to check the math with this link
https://www.islamicfinder.org/islamic-date-converter/
Habib Samander OP  @Reply  
   
5 years ago
Juan C Rivera
Islamic date also called Lunar Hijri date is different from Solar Hijri date, also the number of the days of the months differ in both dates as well.
Juan C Rivera  @Reply  
            
5 years ago
Sorry can't help.  

V/r
Juan
LLNP

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 8/17/2026 7:59:30 AM. PLT: 1s