Solved

How to include the current date into the query's SQL?

Posted on 1998-11-12
2
151 Views
Last Modified: 2010-04-04
I would like to know how can I include the current date into the query's SQL statement? e.g. I need to get a list of cars that will be returned on current day/specific day from a database using query.... but I cant include the date into the SQL statement....

Can someone please help me?
0
Comment
Question by:blueylam
2 Comments
 
LVL 4

Accepted Solution

by:
dwwang earned 100 total points
ID: 1346692
Just write query1.SQL:='Select * frm yourTable where YourDateField=:DateParam and ....'

Then query1.ParamByName('DateParam').AsDateTime:=DesiredDate;(date type variable)
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 1346693
hi blueylam,

in addition to dwwang's correct answer,

you can get the currentdate with the  functions date or now

query1.ParamByName('DateParam').AsDateTime:=Now;

meikl
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now