kavvis
asked on
VB.NET Query Builder
Hi!
I have just found this function in the datset...
What a great function!
However I need some help...
This is what I want to to.
1. Make the query with this new function
Search for example in my databas.
SELECT ID, Datum, Tid, Tag1, Tag2, Tag3
FROM Agnesberg
WHERE (Datum BETWEEN '@Starttemp' AND '@Stoptemp')
But I get problem when I do this.. this is how I doit!
Dim Starttemp, Stoptemp As String
Starttemp = "11:00:00"
Stoptemp = "13:00:00"
Me.AgnesbergTableAdapter.F illBy(Me.H ammarDataS et.Agnesbe rg)
If I instead write like this
SELECT ID, Datum, Tid, Tag1, Tag2, Tag3
FROM Agnesberg
WHERE (Datum BETWEEN '13:01:18' AND '14:01:18')
then it workes!
How do I then make this adresses dynamic?
//Kavvis
I have just found this function in the datset...
What a great function!
However I need some help...
This is what I want to to.
1. Make the query with this new function
Search for example in my databas.
SELECT ID, Datum, Tid, Tag1, Tag2, Tag3
FROM Agnesberg
WHERE (Datum BETWEEN '@Starttemp' AND '@Stoptemp')
But I get problem when I do this.. this is how I doit!
Dim Starttemp, Stoptemp As String
Starttemp = "11:00:00"
Stoptemp = "13:00:00"
Me.AgnesbergTableAdapter.F
If I instead write like this
SELECT ID, Datum, Tid, Tag1, Tag2, Tag3
FROM Agnesberg
WHERE (Datum BETWEEN '13:01:18' AND '14:01:18')
then it workes!
How do I then make this adresses dynamic?
//Kavvis
In your WHERE Clause
...WHERE DATUM>@Starttp AND DATUM
...WHERE DATUM>@Starttp AND DATUM
Or if this statement is in your tableadapter then in your dataset designer create new query and add this where clause.so when you call the table adapter
me.AgnesbergTableAdapter.f ill(hamard ataset.Agn esber,star temp,stopt emp)
me.AgnesbergTableAdapter.f
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Sorry I have been on vacation! Thank you now I close this thred!
SELECT ID, Datum, Tid, Tag1, Tag2, Tag3
FROM Agnesberg
WHERE (Datum BETWEEN @Starttemp AND @Stoptemp)