Message
 
 
To
23/03/2010 13:28:56
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01456639
Message ID:
01456658
Views:
69
This message has been marked as the solution to the initial question of the thread.
>>>hello!
>>>i have this table and my date field gets populated by the date a client was added
>>>supposed i wanna select all my clients based on the year.
>>>i have a spinner. that gets the year.
>>>
>>>im trying to select all from my table where the year = the selected year in the spinner
>>>
>>>so i tried
>>>
>>>select * from mytable where clients.date_Add=thisform.spinner1.value;&& i think i saved that value 2 a variable
>>>into cursor kem
>>>browse
>>>
>>>i wasnt expecting it 2 work and it didnt data type mismatch.
>>>
>>>can i use the year separately ? or do i hav to enter a start date and end and query in between those two. that ive done before
>>
>>What 2 means? 2002?
>>
>>select * from mytable 
>>where clients.date_Add >= date(2000 + thisform.Spinner1.value,1,1)
>> and Clients.Date_Add < date(2000 + 1 + thisform.Spinner1.value, 1,1)
>>into cursor kem nofilter
>
>lol forgive my lazy internet lingo i meant to work. you're using the year 2000 i really didnt wanna hard code a year

Remove 2000 from the code above - as long as you have the actual year in the spinner, this code should work.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View