| | |
access date query
Thread Solved |
•
•
Join Date: Apr 2007
Posts: 30
Reputation:
Solved Threads: 0
hi
i want to obtain a value of a table with date restrictions, so i created two fields, one for the inicial date and other for the final date. when i try to do that the result is always null...i don't no why...
i use this statement:
"SELECT caminho_foto FROM destaques WHERE (data_inicial <= #" & Date.Today & "#) AND (data_final >= #" & Date.Today & "#) ORDER BY id_destaque DESC"
please help me...
i want to obtain a value of a table with date restrictions, so i created two fields, one for the inicial date and other for the final date. when i try to do that the result is always null...i don't no why...
i use this statement:
"SELECT caminho_foto FROM destaques WHERE (data_inicial <= #" & Date.Today & "#) AND (data_final >= #" & Date.Today & "#) ORDER BY id_destaque DESC"
please help me...
•
•
Join Date: Apr 2007
Posts: 30
Reputation:
Solved Threads: 0
by sample data you mean values from the bd table?
the attached imagem is a print of my table, the last two fields are for the inicial and final date (their names are in portuguese, date(eng) = data(pt)), and their are both date/time fields, theres no error but theres no results also.
strangely, if i use the web developer query builder on a accessdatasource with the value 07-05-2007, it works...
the attached imagem is a print of my table, the last two fields are for the inicial and final date (their names are in portuguese, date(eng) = data(pt)), and their are both date/time fields, theres no error but theres no results also.
strangely, if i use the web developer query builder on a accessdatasource with the value 07-05-2007, it works...
•
•
Join Date: Apr 2007
Posts: 30
Reputation:
Solved Threads: 0
well, after one giant headaque i figured out why it didn't work...
in my sql statement i used
so i had:
and now i have:
in my sql statement i used
date.today (or date.today.tostring("d")) to obtain the date. the result was in this format 08-05-2007. the same format as the date fields in my DB. so i thought that the error could not be this, but it is...althought i don't understand i... to work i had to change the dd/mm order to mm/dd using Date.Today.ToString("MM-dd-yyyy").so i had:
"SELECT caminho_foto FROM destaques WHERE (data_inicial <= #" & Date.Today.ToString("d") & "#) AND (data_final >= #" & Date.Today.ToString("d") & "#)"and now i have:
"SELECT caminho_foto FROM destaques WHERE (data_inicial <= #" & Date.Today.ToString("MM-dd-yyyy") & "#) AND (data_final >= #" & Date.Today.ToString("MM-dd-yyyy") & "#)"
![]() |
Similar Threads
- MS Access Date Question (MS Access and FileMaker Pro)
- microsoft access simple date query (Computer Science)
- Microsoft Access date validation (Computer Science)
- Access XP Crashes at Query Run (MS Access and FileMaker Pro)
Other Threads in the ASP.NET Forum
- Previous Thread: need u r help
- Next Thread: Help again please>>>>
Views: 2736 | Replies: 3
| Thread Tools | Search this Thread |
Tag cloud for ASP.NET
.net 2.0 3.5 2005 ajax ajax-doc application asp asp.net asp.net-mvc asp.net_hw_sw authentication authorization beginner browser button c# captcha chat checkbox click compatible connectionstring control crystalreport dataaccesslayer database datagridview datalist delete deployment development dgv dropdown dynamically edit editor encryption expose external feedback fill flash folder form forms gridview homeedition identity iframe iis impersonation index javascript list login maps masterpage membership mysql order panelmasterpagebuttoncontrols parent problem profile purchase ratings read redirect refer request.form search security server session sessionvariables sharepoint silverlight sql sql-server sqlexpress-attach subdomain theft tracking translate-web-pages update user validation vb.net virtualdirectory vista visual-studio visualstudio vs2008 web webdevelopemnt webservice website windows-auth xml





