473,834 Members | 1,547 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Format(Date, "MM/DD/YYYY")

16 New Member

How can I porting this code

to_date('" & Format(Date, "MM/DD/YYYY") & "','mm/dd/yyyy')

from VB to aspx?

SelectCommand=" SELECT * FROM tbl_Products
WHERE tbl_Products.Pr oductStartDate <= to_date('" & Format(Date, "MM/DD/YYYY") & "','mm/dd/yyyy')"

Jan 15 '07 #1
6 3433
4,871 Recognized Expert Specialist
Format(Date, "MM/DD/YYYY")
Jan 16 '07 #2
16 New Member

I don't undestand.
I can't replace

to_date('" & Format(Date, "MM/DD/YYYY") & "','mm/dd/yyyy') (from VB) to
Format(Date, "MM/DD/YYYY")

How can I port to_date('" & Format(Date, "MM/DD/YYYY") & "','mm/dd/yyyy') from VB to asp.net?

Jan 16 '07 #3
24 New Member

The below link explains all date formating. Check it.


Ambika Praveen.
Jan 16 '07 #4
16 New Member
I get the error message :"Cannot switch views:(validati on (asp.net):If this attribute value is enclosed in quotation marks,the quotation marks must match.

SelectCommand=" SELECT Product_Code, Product_ID FROM tbl_Employees,t bl_Factories,tb l_Product_categ ories,tbl_Produ cts
WHERE tbl_Factories.F actory_ID = tbl_Product_cat egories.Factory _ID
AND tbl_Product_cat egories.Product _category_ID = tbl_Products.Pr oduct_category_ ID
AND tbl_Employees.E mployee_ID = tbl_Product_cat egories.Product _category_Manag er_ID
AND tbl_Products.Pr oductStartDate <= to_date('" & Format(Date, "MM/DD/YYYY") & "','mm/dd/yyyy')"

If I close SelectCommand
SelectCommand=" SELECT Product_Code, Product_ID FROM tbl_Employees,t bl_Factories,tb l_Product_categ ories,tbl_Produ cts
WHERE tbl_Factories.F actory_ID = tbl_Product_cat egories.Factory _ID
AND tbl_Product_cat egories.Product _category_ID = tbl_Products.Pr oduct_category_ ID
AND tbl_Employees.E mployee_ID = tbl_Product_cat egories.Product _category_Manag er_ID"

without the last line I getn't the errors.

Jan 16 '07 #5
16 New Member

How can I port >= ?

Jan 16 '07 #6
4,871 Recognized Expert Specialist
I suggest placing the datetime in a variable first, formatting the date and then using it in your select statement. You have already debugged and established the problem, now take this further. Display the variable if it is still not working to see why it might not work...
Jan 17 '07 #7

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

Similar topics

by: Erik R.N. | last post by:
Hi I have a ACCESS2002 table with a date-field in format "dd-mm-yyyy" which I "export" to a txt-file ( ; and " " ) and upload the txt-file to a MYSQL-table where the datefield is a varchar-field. I want to sort on the MYSQL-date-field. How do I get a MYSQL-date-formated "yyyy-mm-dd" field which I can sort on ??
by: Petyr David | last post by:
Just looking for the simplest. right now my perl script returns an error messge to the user if the date string is invalid. would like to do this before accessing the server. TX
by: veaux | last post by:
I'm thinking this is easy but can't get it. I have a table with following: Table1 Date 1/1/2007 Table2 Type 0107 (This is MMYY of above) So I'm having trouble using a query to turn the date from Table 1 into
by: arti | last post by:
I dont want to use Convert(Char(9),date,106) function to show date in dd/MM/yyyy format. It changes the datatype of my column to char & I cant perform other date operations on it without changing it back to datetime. Is there any T-sql way of doing it?
by: mgpsivan | last post by:
Hi, i have form in Asp.net(2003) in that i've to change the format of the date by the following statement Format(Date.Today, "dd/mm/yyyy") but when i give this code the month part displays as 00 i.e i get the output as the folowing for eg: "18/00/2007" can any one help me in changing the format... Thanks in Advance..... Sivan.G.....
by: nudrat | last post by:
I have a form in ASP, where Date has to display in "dd/mm/yyyy" format. when I am saving that format into database its giving either error message or saving incorrect date. because sql used to insert dates in "dd/mm/yyyy" format. say if date is 24 sep 2007, in sql it will not save as "24/09/2007", it will be out of script range error and if date is 3 sep 2007 , then sql will treat as 9 March 2007. please find a solution for that. Thanks &...
by: maminx | last post by:
Hello all, asking again i want to convert format date from "YYYY-mm-dd" to "dd-mm-YYYY" example from "2008-08-16" become format date like this one "16-08-2008" is it anyone who has this library??thanks
by: JFKJr | last post by:
Hello everyone, this one might be simple but driving me crazy! Your help will be greatly appreciated. Basically, I created a textbox bound to "Date" field in an Access VBA form. But when the field has date in "mm/dd/yyyy" format (for ex: 09/03/2008), the textbox displays it as 9/3/2008. Can anyone suggest how to display date in "mm/dd/yyyy" format in a bounded textbox. Thanks!
by: | last post by:
Hi, I program in asp.net. I have a date in TextBox in format "dd/MM/yyyy". I would like to validate if the date is realy correct. I used RegularExpressionValidator with ValidationExpression="//", but user can write date "31/02/2000" and validator says that it is correct (everybody know that Febuary has 28 or 29 days).
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.