Click here to Skip to main content
16,004,505 members
Home / Discussions / Database
   

Database

 
GeneralRe: Unicode in SQL query Pin
Varghese Paul M6-Jan-09 0:46
Varghese Paul M6-Jan-09 0:46 
GeneralRe: Unicode in SQL query Pin
Wendelius6-Jan-09 0:48
mentorWendelius6-Jan-09 0:48 
QuestionHow can i do this query?? [modified] Pin
foryou5-Jan-09 22:39
foryou5-Jan-09 22:39 
AnswerRe: How can i do this query?? Pin
Wendelius5-Jan-09 23:03
mentorWendelius5-Jan-09 23:03 
GeneralRe: How can i do this query?? Pin
foryou7-Jan-09 1:10
foryou7-Jan-09 1:10 
GeneralRe: How can i do this query?? [modified] Pin
Wendelius7-Jan-09 1:21
mentorWendelius7-Jan-09 1:21 
GeneralRe: How can i do this query?? Pin
foryou7-Jan-09 1:41
foryou7-Jan-09 1:41 
GeneralRe: How can i do this query?? Pin
Wendelius7-Jan-09 2:01
mentorWendelius7-Jan-09 2:01 
foryou wrote:
sorry I dont speak English well


No problem at all

foryou wrote:
what I am in the textbox is the system date (detetime)
example :
07/01/2009 11:59:16


ok, you may encounter a conversion problem. If you're using literals (which I do not encourage at all) you would have a query like
select ...
from   ...
where CONVERT(datetime, '07/01/2009 11:59:16', 101) between date1 and date2


You can test this for example like this:
select * 
from  sysobjects 
where CONVERT(datetime, '01/07/2009 11:59:16',101) -- now
between GETDATE()-1  -- yesterday
and     GETDATE()+1  -- tomorrow

Notice that the format is mm/dd/yyyy. if you want to use dd/mm/yyyy, you should use British/French format:
CONVERT(datetime, '07/01/2009 11:59:16', 103)


However you won't have these problems at all if you use parameters. Then your query would look like
select ...
from   ...
where @SomeDateParameter between date1 and date2

There are good examples in BOL: SqlParameter[^].


foryou wrote:
Merci Mika Wendelius


Ne rien. (I hope it was correct Smile | :) )

The need to optimize rises from a bad design.My articles[^]

GeneralRe: How can i do this query?? Pin
foryou8-Jan-09 22:19
foryou8-Jan-09 22:19 
GeneralRe: How can i do this query?? Pin
Wendelius8-Jan-09 23:26
mentorWendelius8-Jan-09 23:26 
QuestionHow to get LSN detail of a Log backup in sql server Pin
PadmaPriya.S5-Jan-09 22:39
PadmaPriya.S5-Jan-09 22:39 
AnswerRe: How to get LSN detail of a Log backup in sql server Pin
Wendelius5-Jan-09 22:57
mentorWendelius5-Jan-09 22:57 
GeneralRe: How to get LSN detail of a Log backup in sql server Pin
PadmaPriya.S5-Jan-09 23:05
PadmaPriya.S5-Jan-09 23:05 
GeneralRe: How to get LSN detail of a Log backup in sql server Pin
Wendelius5-Jan-09 23:15
mentorWendelius5-Jan-09 23:15 
GeneralRe: How to get LSN detail of a Log backup in sql server Pin
PadmaPriya.S5-Jan-09 23:20
PadmaPriya.S5-Jan-09 23:20 
GeneralRe: How to get LSN detail of a Log backup in sql server Pin
Wendelius5-Jan-09 23:33
mentorWendelius5-Jan-09 23:33 
GeneralRe: How to get LSN detail of a Log backup in sql server Pin
PadmaPriya.S5-Jan-09 23:41
PadmaPriya.S5-Jan-09 23:41 
GeneralRe: How to get LSN detail of a Log backup in sql server Pin
Wendelius5-Jan-09 23:53
mentorWendelius5-Jan-09 23:53 
QuestionProblem With Case When then Pin
ais075-Jan-09 18:25
ais075-Jan-09 18:25 
AnswerRe: Problem With Case When then Pin
Ashfield5-Jan-09 21:06
Ashfield5-Jan-09 21:06 
GeneralRe: Problem With Case When then Pin
Wendelius6-Jan-09 4:23
mentorWendelius6-Jan-09 4:23 
GeneralRe: Problem With Case When then Pin
Ashfield6-Jan-09 9:12
Ashfield6-Jan-09 9:12 
GeneralRe: Problem With Case When then [modified] Pin
Wendelius6-Jan-09 9:20
mentorWendelius6-Jan-09 9:20 
QuestionRestoring backup of main server into local server Pin
Shravanthi5-Jan-09 17:52
Shravanthi5-Jan-09 17:52 
AnswerRe: Restoring backup of main server into local server Pin
Wendelius5-Jan-09 21:48
mentorWendelius5-Jan-09 21:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.