|
-
May 14th, 2006, 02:19 AM
#1
Thread Starter
Member
Dates format
Dear All,
I would like to compare a selected Date with a range of dates in sqlserver database.
The date format is dd/mm/yyyy and computer system date is also the same.
but the problem is when i run the query it doesn't return a result but if
the matching date was in the format mm/dd/yyyy the query will return the
date.
the database collation is latin_general.
I need the query to match the date format dd/mm/yyyy
so how can i solve the problem??
-
May 14th, 2006, 03:03 AM
#2
Re: Dates format
You can use DatePart or Month, Day, Year concatenated to make your needed format. Or you can Cast or Convert it the the date format you need. All can be done in the sql query.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
May 14th, 2006, 07:27 AM
#3
Re: Dates format
 Originally Posted by Octopus
Dear All,
I would like to compare a selected Date with a range of dates in sqlserver database.
The date format is dd/mm/yyyy and computer system date is also the same.
but the problem is when i run the query it doesn't return a result but if
the matching date was in the format mm/dd/yyyy the query will return the
date.
the database collation is latin_general.
I need the query to match the date format dd/mm/yyyy
so how can i solve the problem??
Dates are displayed in those formats.
In MS SQL dates are stored as integer values.
Your problem is related to how you are formatting dates between VB and the query.
Show some code and we can deal with the actual issue.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|