Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems with dates

Status
Not open for further replies.

NiteCrawlr

Programmer
Mar 16, 2001
140
BR
Hi,
I'm having problems in this line:

Select * from ngrm10 where pcc_grm = '&quot;&pcc&&quot;' and dte_grm >= '&data_ini&' and dte_grm <= '&data_fim&'&quot;

Can I do this?? Is this right??
this is the error:

Microsoft OLE DB Provider for ODBC Drivers error '80040e07'

[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting datetime from character string.

/rayan/resultado.asp, line 66

Obs: dte_grm has datetime properties (SQL Server 7)

Thanks

Frederico
 
It seems like your &quot;&quot; marks are off
try this

Select * from ngrm10 where pcc_grm = '&quot;&pcc&&quot;' and dte_grm >= '&quot;&data_ini&&quot;' and dte_grm <= '&quot;&data_fim&&quot;'&quot;

hopefully that does it for you.
leo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top