How to use parameters rather string statement


Author
Message
Juan Carlos Pazos
Juan Carlos Pazos
StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 reputation)
Group: Forum Members
Posts: 144, Visits: 227
Hi

I have this:

Dim currenthmonth As Integer

Dim currentyear As Integer

currenthmonth = Date.Now.Month

currentyear = Date.Now.Year

Me.FillDataTable("SELECT * FROM Sales WHERE Payment = 1 AND Month(DatePay) =" & currenthmonth & " AND Year(DatePay)=" & currentyear & "")

But I read that in SF help that is best use paramaters, I have used parameters in other queries and not problem with boolean fields, but I can not make it work using the Month function. I need this for recover only sales orders for current month and year.

Kindest regards.

Smile Everything is possible, just keep trying...

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Juan Carlos Pazos - 15 Years Ago
Edhy Rijo - 15 Years Ago
Greg McGuffey - 15 Years Ago
Juan Carlos Pazos - 15 Years Ago
                     Hi Juan,

I have no idea what are you asking form. Please...
Edhy Rijo - 15 Years Ago
                         Hi Edhy This is the code you give as sample: Using cmd As New...
Juan Carlos Pazos - 15 Years Ago
                             [quote][b]Juan Carlos Pazos (10/06/2009)[/b][hr]Where does...
Edhy Rijo - 15 Years Ago
                                 I think you're just missing it by a bit here Juan.

Two...
Greg McGuffey - 15 Years Ago
                                     Thanks Greg I follow your explanetion and finally get this work. Here...
Juan Carlos Pazos - 15 Years Ago
                                         Glad you got it working. Once you understand it, this is pretty...
Greg McGuffey - 15 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search