473,327 Members | 1,997 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Query Search by date - SQL

I am working in access project, so the backend of the system is SQL, I tried to build a query to retrieve the data based on the date, the date appear in different form in a text box, so when I put the date in the text box and run the query I need the query to give me the data based on the date in the Text box. I tried to put in the query as following
Like [forms]![Main]![Text49]

but its not working like regular Ms Access query, it keeps giving me (Your entry cannot be converted to a valid date time value), can you help me with this query please?
This is the code for the query
Expand|Select|Wrap|Line Numbers
  1.  INSERT INTO dbo.AccTDailyT
  2.                         (No, AccountNo, AccountName, AccountName2, Balance, TransDate)
  3. SELECT      No, AccountNo, AccountName, AccountName2, Balance, TransDate
  4. FROM          dbo.Acct_DataT
  5. ORDER BY No 
Thank you in advance for your help
Oct 18 '12 #1
4 3505
Rabbit
12,516 Expert Mod 8TB
It's a pretty clear message, whatever date you're trying to insert isn't a real date.
Oct 18 '12 #2
Okay, I believe in access project you need to put another formula to run this query, not like the regular ms access when you put this formula its working fine
Like [forms]![Main]![Text49]
and it shows you the correct data,
But in MS Access project - SQL it doesn’t work,
Can you please help me with what formula that I have to but in the criteria or give me the correct code??
[IMG]C:\Documents and Settings\malsamhouri\My Documents\My Pictures\untitled[/IMG]
Oct 18 '12 #3
Rabbit
12,516 Expert Mod 8TB
Are you talking about your other thread? You have no where criteria in the SQL you posted above.

Also, I can't see the picture you posted. You forgot to attach it to the thread.
Oct 18 '12 #4
twinnyfo
3,653 Expert Mod 2GB
Also, if you are simply looking for exact dates, there is no need for the "Like" statement. Date comparison can simpy use "=". You may need to use the date delimiter "#" concatenated around the date your are looking for, however.
Oct 19 '12 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: vnl | last post by:
I'm trying to run a SQL query but can't find any records when trying to select a certain date. Here's the sql: SELECT field 1, field2, date_and_time, FROM table1 WHERE date_and_time =...
5
by: Dani | last post by:
Hi, I´m no superuser when it comes to MS Access. So I use MS Query to pull out info from an SQL database to Excel. I have a tabel containing different "titles" or "colums". One contains a date....
2
by: Julie Wardlow | last post by:
Help! I am calculating a future date using the DateAdd function in a query (the calculation also involves an IIf statement), and have managed to get this formula to produce the required result....
2
by: Paul Revere | last post by:
Hi, all of you! I am new to this community. I am a web designer and a friend of mine and I have a server and manage websites (mostly ours but also a few clients). I manage the sites and he does...
3
by: Scotter | last post by:
Hi, I've been trying to make a report that will show the deliverys to be made between 2 dates, or the deliverys to be made after a certian date, or the deliveries that were made before a certian...
4
Sandboxer
by: Sandboxer | last post by:
I want to be able to program Access to provide for me, by individual day, what my contract obligations are to my customers. Will Access recognize all the individual days in between a date range...
0
by: KevLe | last post by:
I'm building a log search function in c# for a certain management app and would like some help on the design how to solve this, here is my solution (on paper) so far: The log files are saved to...
7
by: nhkam | last post by:
I am using MS Access 2007 I have a transaction table which holds all records with posting date on each of them. I used a make table query to find out the max date hold in the transaction table and...
0
by: tasawer | last post by:
Hi, I have date and time fields for when the vehicle left the car park and when it returned. (dateout timeout datein timein) how can I create a query to search for the exact date and time to...
0
by: Martin Ruprecht | last post by:
Hi, I do have a big problem: We are creating a reporting tool for logistic solutions using Crystal Reports. I actually am programming a history report. There are millions of lines in the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.