delphi,sql语句中引用时间变量有关问题
delphi,sql语句中引用时间变量问题
就上面想在where子句中加个比较时间的,t1和t2都是时间变量,具体要怎么写,大神们
------解决思路----------------------
用字符串表达式:
'SELECT a.编码 from a where a.入库时间 between ' + QuotedStr('2015-9-9 10:00:00') +' AND '+QuotedStr('2015-9-10 10:00:00')
------解决思路----------------------
'SELECT a.编码 from a where a.入库时间 between ''2015-9-9 10:00:00'' AND ''2015-9-10 10:00:00''';
'SELECT a.编码 from a where a.入库时间 between '''+BeginString+''' AND '''+endString+'''';
t1:=StartOfTheMonth(DateTimePicker1.Date);
t2:=EndOfTheMonth(DateTimePicker1.Date);
str1:='SELECT a.编码 from a where a.入库时间 between t1 and t2
就上面想在where子句中加个比较时间的,t1和t2都是时间变量,具体要怎么写,大神们
------解决思路----------------------
用字符串表达式:
'SELECT a.编码 from a where a.入库时间 between ' + QuotedStr('2015-9-9 10:00:00') +' AND '+QuotedStr('2015-9-10 10:00:00')
------解决思路----------------------
'SELECT a.编码 from a where a.入库时间 between ''2015-9-9 10:00:00'' AND ''2015-9-10 10:00:00''';
'SELECT a.编码 from a where a.入库时间 between '''+BeginString+''' AND '''+endString+'''';