Clarification on Date format

Kindly check whether the arrangement of the SQL below with date format is Okay:

SELECT Qry10003CustomerLedgerunion.CustomerID, Qry10003CustomerLedgerunion.AccountID, Qry10003CustomerLedgerunion.Company, Qry10003CustomerLedgerunion.InvoiceID, Qry10003CustomerLedgerunion.CDate, Qry10003CustomerLedgerunion.Debit, Qry10003CustomerLedgerunion.Credit, ([Debit]-[Credit]) AS Balance, Qry10003CustomerLedgerunion.Reference
FROM Qry10003CustomerLedgerunion
WHERE (((Qry10003CustomerLedgerunion.CustomerID)=[Forms]![frmCityLedger]![CboCustomerID]) AND ((Qry10003CustomerLedgerunion.AccountID)=[Forms]![frmCityLedger]![CboAccountId]) AND ((Qry10003CustomerLedgerunion.CDate) Between Format(([Forms]![frmCityLedger]![txtDateA]),"yyyy\/mm\/dd") And Format(([Forms]![frmCityLedger]![txtEndB]),"yyyy\/mm\/dd")));

At the moment I have no issues the query seam to be working properly , but I just want a second opinion on this.

Regards

Chris
LVL 3
Hankwembo Christopher,FCCA,FZICA,CIA,MAAT,B.A.ScDirectorAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Pawan KumarDatabase ExpertCommented:
This format (yyyy\/mm\/dd) is good. Continue with the this or use below

yyyymmdd

Above is what is use and it works in all the cases.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
considering [Forms]![frmCityLedger]![txtDateA] and [Forms]![frmCityLedger]![txtEndB] are textbox controls, they stored what you have entered.

if these controls already contain values in yyyy/mm/dd, what's the reason to re-format it again to yyyy/mm/dd?
0
Hankwembo Christopher,FCCA,FZICA,CIA,MAAT,B.A.ScDirectorAuthor Commented:
considering [Forms]![frmCityLedger]![txtDateA] and [Forms]![frmCityLedger]![txtEndB] are textbox controls, they stored what you have entered.

if these controls already contain values in yyyy/mm/dd, what's the reason to re-format it again to yyyy/mm/dd?

No format at control text only the query itself!

Regards

Chris
0
Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
what i'm emphasizing is if your value already in format of yyyy/mm/dd, what for to format it again using format function?

anyway, it's your choice
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
SQL

From novice to tech pro — start learning today.