473,378 Members | 1,447 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,378 software developers and data experts.

A questionf format

Ray
I am entering dates in to form using the dd/mm/yy format, however I am
using a SQL which involves searching for those dates. I have formatted
the dates in the SQL ot the US format of mm/dd/yy as follows -

strSearch = "Select * FROM tblReservations where [RoomNo] = " &
F![tblTemp]![RoomNo] _
& " AND [BeginDate] >= #" & Format(F![tblTemp]![Outdate],
"mm/dd/yy") & "# " _
& " OR [EndDate] <= #" & Format(F![tblTemp]![Indate], "mm/dd/yy") &
"#;"

There appears to be a conflict when I use the SQL statement. What
should I be doing?

I havethe regional setting on dd/mm/yy. Does this make a difference.
This is driving me bonkers.... far more than usual.

TIA - Ray
Nov 12 '05 #1
2 1113
Ray wrote:
I am entering dates in to form using the dd/mm/yy format, however I am
using a SQL which involves searching for those dates. I have formatted
the dates in the SQL ot the US format of mm/dd/yy as follows -

strSearch = "Select * FROM tblReservations where [RoomNo] = " &
F![tblTemp]![RoomNo] _
& " AND [BeginDate] >= #" & Format(F![tblTemp]![Outdate],
"mm/dd/yy") & "# " _
& " OR [EndDate] <= #" & Format(F![tblTemp]![Indate], "mm/dd/yy") &
"#;"

There appears to be a conflict when I use the SQL statement. What
should I be doing?

I havethe regional setting on dd/mm/yy. Does this make a difference.
This is driving me bonkers.... far more than usual.


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

What's this "F![tblTemp]![Outdate]" syntax? If you are referencing a
control on a form the correct syntax is:

Forms!FormName!ControlName

If you are referencing a column in another table the correct syntax is:

TableName.ColumnName

and, you have to include the table name in the SQL FROM clause.

Advice: use the correct data type prefixes. IOW, don't use "tbl" for a
form name prefix, because "tbl" is the common prefix to a table name.

- --
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQGzXaIechKqOuFEgEQK7SACeO/482Y2Ramqsl1rqxcfaTtoFmXcAnizA
oKQZwO8ub8LrfW3PShnGIqUJ
=FWsu
-----END PGP SIGNATURE-----

Nov 12 '05 #2
And what is this Format doing in an sql code. I think you make the same
mistake about dates as many other. Dates are stored as date values - no
matter what format they are entered or displayed in. When you search for
them, you search for the value. When you set the format to any date format
in the form, you should just reference the field directly. (But if you
only use an input mask and have it as a text field - then you need to
convert it to a date value using DateValue() , and I expect that the field
in the table is a date type.)

Brgds
Rolfern

"MGFoster" <me@privacy.com> wrote in message
news:xH*******************@newsread1.news.pas.eart hlink.net...
Ray wrote:
I am entering dates in to form using the dd/mm/yy format, however I am
using a SQL which involves searching for those dates. I have formatted
the dates in the SQL ot the US format of mm/dd/yy as follows -

strSearch = "Select * FROM tblReservations where [RoomNo] = " &
F![tblTemp]![RoomNo] _
& " AND [BeginDate] >= #" & Format(F![tblTemp]![Outdate],
"mm/dd/yy") & "# " _
& " OR [EndDate] <= #" & Format(F![tblTemp]![Indate], "mm/dd/yy") &
"#;"

There appears to be a conflict when I use the SQL statement. What
should I be doing?

I havethe regional setting on dd/mm/yy. Does this make a difference.
This is driving me bonkers.... far more than usual.


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

What's this "F![tblTemp]![Outdate]" syntax? If you are referencing a
control on a form the correct syntax is:

Forms!FormName!ControlName

If you are referencing a column in another table the correct syntax is:

TableName.ColumnName

and, you have to include the table name in the SQL FROM clause.

Advice: use the correct data type prefixes. IOW, don't use "tbl" for a
form name prefix, because "tbl" is the common prefix to a table name.

- --
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQGzXaIechKqOuFEgEQK7SACeO/482Y2Ramqsl1rqxcfaTtoFmXcAnizA
oKQZwO8ub8LrfW3PShnGIqUJ
=FWsu
-----END PGP SIGNATURE-----

Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Lowell Kirsh | last post by:
In Peter Norvig's Infrequently Answered Questions he explains that the following 2 fnctions look almost identical but are not the same: def printf(format, *args): print format % args, def...
15
by: Simon Brooke | last post by:
I'm investigating a bug a customer has reported in our database abstraction layer, and it's making me very unhappy. Brief summary: I have a database abstraction layer which is intended to...
3
by: stevek | last post by:
How do I format an integer. Add commas. 1234565 1,234,565 TIA
6
by: Dario Di Bella | last post by:
Hi all, we have the following urgent issue affecting our development team. Initially we had one particular workstation that failed executing queries on a DB2 database, raising an invalid date...
2
by: Ray | last post by:
I am entering dates in to form using the dd/mm/yy format, however I am using a SQL which involves searching for those dates. I have formatted the dates in the SQL ot the US format of mm/dd/yy as...
3
by: Melissa | last post by:
What specifically causes the Format event of a report's section to fire? Thanks! Melissa
11
by: Grumble | last post by:
Hello, I have the following structure: struct foo { char *format; /* format string to be used with printf() */ int nparm; /* number of %d specifiers in the format string */ /* 0 <= nparm <=...
4
by: David Morris | last post by:
Hi Could somebody please explain what the following line of code means String.Format("{0}\{1}.{2:00}", C:\, myfile.txt, 1 It's actually the first argument that I don't understand. What is...
13
by: Roy | last post by:
Hi all, I'm creating a project that should always use this date format when displays the dates or create dates. The back end database is a SQL Server and I like to know what is the logical way...
3
by: Carl Trachte | last post by:
Hello. Python 3.0.a1 has been released. I'm trying to get the hang of the new string formatting in the form: '5.66' There are more options in PEP 3101 (fill, alignment, etc.), but I'm having...
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.