Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

This is what im trying to acheive

 

ComboBox.DataSource = ds.Tables(0)

ComboBox.DisplayMember = Format("CollumnName", "dd/MM/yyyy")

ContractDate.SelectedIndex = -1

 

where collumnname is of time date/time in access.

 

 

i want to display just the date and not the time

  • *Experts*
Posted

I may be corrected by anyone but I think your combobox.displaymember will be a string.

 

You'll need to convert it to date first, then do the format.

Posted
Just set the format of the field in your Access database table to short date format and no further work will be required by you.
My website
Posted

sorry i did not work

 

i already had it to short date. the problem is im getting it correctly from the sql statement . combobox does a ToString and that is when time is added. so... pls help !!

  • Moderators
Posted

As I stated in my previous post, do your formatting in your SQL...

'FieldDate being your column name in the table

"SELECT FieldOne, Fieldtwo, Format(DateValue([FieldDate]),"dd/mm/yyyy") AS myDate FROM myTable"

 

Hog - The problem with setting as ShortDate at the table level is that the format would change depending on the OS culture settings. Some countries are 'dd/mm/yy' others 'mm/dd/yy'

Visit...Bassic Software

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...