sql v/s ms access
-
sql query aur ms access main when i pass "select maid) from enquiry where regdate=#05/11/2009#" from sql access treate it as 11/05/2009 why??? and wats the solution
-
sql query aur ms access main when i pass "select maid) from enquiry where regdate=#05/11/2009#" from sql access treate it as 11/05/2009 why??? and wats the solution
Try this
select maid) from enquiry where regdate=#05/Nov/2009#
or this
select maid) from enquiry where regdate=#2009/11/05#
Read up on datetime
-
Try this
select maid) from enquiry where regdate=#05/Nov/2009#
or this
select maid) from enquiry where regdate=#2009/11/05#
Read up on datetime
But for this i have to change Date/Time format of System to what u written.
-
But for this i have to change Date/Time format of System to what u written.
In Access you MUST be storing your data as a datetime data type, if you are storing it as varchar/string then you are screwed. SQL Server has a dateformat, I presume that Access has something similar (I know it has I just can't remember the format). This will allow you to control the format of the datestring when you need it.
-
In Access you MUST be storing your data as a datetime data type, if you are storing it as varchar/string then you are screwed. SQL Server has a dateformat, I presume that Access has something similar (I know it has I just can't remember the format). This will allow you to control the format of the datestring when you need it.
Thats true, type in access is date/time and format is "Short Date - 26/12/2009". When i call this through SQL it change dd/mm/yyyy to mm/dd/yyyy. Where to change, in sql or access??? As i cant change system date / time format. tell
-
Thats true, type in access is date/time and format is "Short Date - 26/12/2009". When i call this through SQL it change dd/mm/yyyy to mm/dd/yyyy. Where to change, in sql or access??? As i cant change system date / time format. tell
sachees123 wrote:
Where to change, in sql or access???
Well, do you want to change the format that Access uses, or the one that SQL Server uses? For SQL Server, you'd set the time format like this;
SET DATEFORMAT ydm;
sachees123 wrote:
As i cant change system date / time format.
The user is the one who sets (or changes) the format, from the control panel. Other applications should display their dates using the format that the user provides. That means that one saves a datetime as a
DATE
-type. When displaying, convert to a string of theShortDateFormat
orLongDateFormat
:)I are Troll :suss:
-
sachees123 wrote:
Where to change, in sql or access???
Well, do you want to change the format that Access uses, or the one that SQL Server uses? For SQL Server, you'd set the time format like this;
SET DATEFORMAT ydm;
sachees123 wrote:
As i cant change system date / time format.
The user is the one who sets (or changes) the format, from the control panel. Other applications should display their dates using the format that the user provides. That means that one saves a datetime as a
DATE
-type. When displaying, convert to a string of theShortDateFormat
orLongDateFormat
:)I are Troll :suss:
I dont want to change any format anywhere. Its the access which is changing the format from dd/mm/yyyy to mm/dd/yyyy. Why it is doing and wats the solution?? Thats my question.
-
I dont want to change any format anywhere. Its the access which is changing the format from dd/mm/yyyy to mm/dd/yyyy. Why it is doing and wats the solution?? Thats my question.
sachees123 wrote:
Its the access which is changing the format from dd/mm/yyyy to mm/dd/yyyy.
Databases don't store dates in a specific format, they store them as numbers[^]. The database applies one of the predefined dateformats when you retrieve the value. You can change[^] the table-design to change the default format that's used for the date-column though.
I are Troll :suss: